0x40023000: Cyclic redundancy check calculation unit
3/8 fields covered. Toggle Registers
| Offset | Name | 31 |
30 |
29 |
28 |
27 |
26 |
25 |
24 |
23 |
22 |
21 |
20 |
19 |
18 |
17 |
16 |
15 |
14 |
13 |
12 |
11 |
10 |
9 |
8 |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x0 | CRC_DR | ||||||||||||||||||||||||||||||||
| 0x4 | CRC_IDR | ||||||||||||||||||||||||||||||||
| 0x8 | CRC_CR | ||||||||||||||||||||||||||||||||
| 0x10 | CRC_INIT | ||||||||||||||||||||||||||||||||
| 0x14 | CRC_POL | ||||||||||||||||||||||||||||||||
Data register
Offset: 0x0, reset: 0xFFFFFFFF, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
DR
rw |
|||||||||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
DR
rw |
|||||||||||||||
Independent data register
Offset: 0x4, reset: 0x00000000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
IDR
rw |
|||||||||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
IDR
rw |
|||||||||||||||
Control register
Offset: 0x8, reset: 0x00000000, access: Unspecified
3/4 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
REV_OUT
rw |
REV_IN
rw |
POLYSIZE
rw |
RESET
w |
||||||||||||
Initial CRC value
Offset: 0x10, reset: 0xFFFFFFFF, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
CRC_INIT
rw |
|||||||||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
CRC_INIT
rw |
|||||||||||||||
polynomial
Offset: 0x14, reset: 0x04C11DB7, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
POL
rw |
|||||||||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
POL
rw |
|||||||||||||||
0x40015800: Debug support
19/19 fields covered. Toggle Registers
| Offset | Name | 31 |
30 |
29 |
28 |
27 |
26 |
25 |
24 |
23 |
22 |
21 |
20 |
19 |
18 |
17 |
16 |
15 |
14 |
13 |
12 |
11 |
10 |
9 |
8 |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x0 | IDCODE | ||||||||||||||||||||||||||||||||
| 0x4 | DBG_CR | ||||||||||||||||||||||||||||||||
| 0x8 | DBG_APB_FZ1 | ||||||||||||||||||||||||||||||||
| 0xC | DBG_APB_FZ2 | ||||||||||||||||||||||||||||||||
MCU Device ID Code Register
Offset: 0x0, reset: 0x0, access: read-only
2/2 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
REV_ID
r |
|||||||||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
DEV_ID
r |
|||||||||||||||
DBG configuration register
Offset: 0x4, reset: 0x00000000, access: read-write
2/2 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
DBG_STANDBY
rw |
DBG_STOP
rw |
||||||||||||||
Bit 1: Debug Stop mode Debug options in Stop mode. Upon Stop mode exit, the software must re-establish the desired clock configuration..
Allowed values:
0x0: B_0x0: All clocks disabled, including FCLK and HCLK. Upon Stop mode exit, the CPU is clocked by the HSI internal RC oscillator.
0x1: B_0x1: FCLK and HCLK running, derived from the internal RC oscillator remaining active. If Systick is enabled, it may generate periodic interrupt and wake up events.
Bit 2: Debug Standby and Shutdown modes Debug options in Standby or Shutdown mode..
Allowed values:
0x0: B_0x0: Digital part powered. From software point of view, exiting Standby and Shutdown modes is identical as fetching reset vector (except for status bits indicating that the MCU exits Standby)
0x1: B_0x1: Digital part powered and FCLK and HCLK running, derived from the internal RC oscillator remaining active. The MCU generates a system reset so that exiting Standby and Shutdown has the same effect as starting from reset.
DBG APB freeze register 1
Offset: 0x8, reset: 0x00000000, access: read-write
10/10 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
DBG_LPTIM1_STOP
rw |
DBG_LPTIM2_STOP
rw |
DBG_I2C1_SMBUS_TIMEOUT
rw |
|||||||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
DBG_IWDG_STOP
rw |
DBG_WWDG_STOP
rw |
DBG_RTC_STOP
rw |
DBG_TIM7_STOP
rw |
DBG_TIM6_STOP
rw |
DBG_TIM3_STOP
rw |
DBG_TIM2_STOP
rw |
|||||||||
DBG APB freeze register 2
Offset: 0xC, reset: 0x00000000, access: read-write
5/5 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
DBG_TIM17_STOP
rw |
DBG_TIM16_STOP
rw |
DBG_TIM15_STOP
rw |
|||||||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
DBG_TIM14_STOP
rw |
DBG_TIM1_STOP
rw |
||||||||||||||
1073872896: DMA controller
56/71 fields covered. Toggle Registers
| Offset | Name | 31 |
30 |
29 |
28 |
27 |
26 |
25 |
24 |
23 |
22 |
21 |
20 |
19 |
18 |
17 |
16 |
15 |
14 |
13 |
12 |
11 |
10 |
9 |
8 |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x0 | CR | ||||||||||||||||||||||||||||||||
| 0x0 | ISR | ||||||||||||||||||||||||||||||||
| 0x4 | IFCR | ||||||||||||||||||||||||||||||||
| 0x4 | NDTR | ||||||||||||||||||||||||||||||||
| 0x8 | PAR | ||||||||||||||||||||||||||||||||
| 0xC | MAR | ||||||||||||||||||||||||||||||||
low interrupt status register
Offset: 0x0, reset: 0, access: read-only
28/28 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
TEIF7
r |
HTIF7
r |
TCIF7
r |
GIF7
r |
TEIF6
r |
HTIF6
r |
TCIF6
r |
GIF6
r |
TEIF5
r |
HTIF5
r |
TCIF5
r |
GIF5
r |
||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
TEIF4
r |
HTIF4
r |
TCIF4
r |
GIF4
r |
TEIF3
r |
HTIF3
r |
TCIF3
r |
GIF3
r |
TEIF2
r |
HTIF2
r |
TCIF2
r |
GIF2
r |
TEIF1
r |
HTIF1
r |
TCIF1
r |
GIF1
r |
high interrupt status register
Offset: 0x4, reset: 0, access: read-only
28/28 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
CTEIF7
r |
CHTIF7
r |
CTCIF7
r |
CGIF7
r |
CTEIF6
r |
CHTIF6
r |
CTCIF6
r |
CGIF6
r |
CTEIF5
r |
CHTIF5
r |
CTCIF5
r |
CGIF5
r |
||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
CTEIF15
r |
CHTIF4
r |
CTCIF4
r |
CGIF4
r |
CTEIF3
r |
CHTIF3
r |
CTCIF3
r |
CGIF3
r |
CTEIF2
r |
CHTIF2
r |
CTCIF2
r |
CGIF2
r |
CTEIF1
r |
CHTIF1
r |
CTCIF1
r |
CGIF1
r |
DMA channel 1 number of data tegister
Offset: 0x4, reset: 0, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
NDT
rw |
|||||||||||||||
DMA channel 1 peripheral address
Offset: 0x8, reset: 0, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
PA
rw |
|||||||||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
PA
rw |
|||||||||||||||
DMA channel 1 memory address
Offset: 0xC, reset: 0, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
MA
rw |
|||||||||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
MA
rw |
|||||||||||||||
1073873920: DMA controller
40/55 fields covered. Toggle Registers
| Offset | Name | 31 |
30 |
29 |
28 |
27 |
26 |
25 |
24 |
23 |
22 |
21 |
20 |
19 |
18 |
17 |
16 |
15 |
14 |
13 |
12 |
11 |
10 |
9 |
8 |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x0 | CR | ||||||||||||||||||||||||||||||||
| 0x0 | ISR | ||||||||||||||||||||||||||||||||
| 0x4 | IFCR | ||||||||||||||||||||||||||||||||
| 0x4 | NDTR | ||||||||||||||||||||||||||||||||
| 0x8 | PAR | ||||||||||||||||||||||||||||||||
| 0xC | MAR | ||||||||||||||||||||||||||||||||
DMA channel 1 number of data tegister
Offset: 0x4, reset: 0, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
NDT
rw |
|||||||||||||||
DMA channel 1 peripheral address
Offset: 0x8, reset: 0, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
PA
rw |
|||||||||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
PA
rw |
|||||||||||||||
DMA channel 1 memory address
Offset: 0xC, reset: 0, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
MA
rw |
|||||||||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
MA
rw |
|||||||||||||||
0x40020800: DMAMUX
51/91 fields covered. Toggle Registers
| Offset | Name | 31 |
30 |
29 |
28 |
27 |
26 |
25 |
24 |
23 |
22 |
21 |
20 |
19 |
18 |
17 |
16 |
15 |
14 |
13 |
12 |
11 |
10 |
9 |
8 |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x0 | DMAMUX_C0CR | ||||||||||||||||||||||||||||||||
| 0x4 | DMAMUX_C1CR | ||||||||||||||||||||||||||||||||
| 0x8 | DMAMUX_C2CR | ||||||||||||||||||||||||||||||||
| 0xC | DMAMUX_C3CR | ||||||||||||||||||||||||||||||||
| 0x10 | DMAMUX_C4CR | ||||||||||||||||||||||||||||||||
| 0x14 | DMAMUX_C5CR | ||||||||||||||||||||||||||||||||
| 0x18 | DMAMUX_C6CR | ||||||||||||||||||||||||||||||||
| 0x80 | DMAMUX_CSR | ||||||||||||||||||||||||||||||||
| 0x84 | DMAMUX_CFR | ||||||||||||||||||||||||||||||||
| 0x100 | DMAMUX_RG0CR | ||||||||||||||||||||||||||||||||
| 0x104 | DMAMUX_RG1CR | ||||||||||||||||||||||||||||||||
| 0x108 | DMAMUX_RG2CR | ||||||||||||||||||||||||||||||||
| 0x10C | DMAMUX_RG3CR | ||||||||||||||||||||||||||||||||
| 0x140 | DMAMUX_RGSR | ||||||||||||||||||||||||||||||||
| 0x144 | DMAMUX_RGCFR | ||||||||||||||||||||||||||||||||
DMAMUX request generator interrupt status register
Offset: 0x140, reset: 0x00000000, access: read-only
4/4 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
OF3
r |
OF2
r |
OF1
r |
OF0
r |
||||||||||||
Bit 0: Trigger overrun event flag The flag is set when a new trigger event occurs on DMA request generator channel x, before the request counter underrun (the internal request counter programmed via the GNBREQ field of the DMAMUX_RGxCR register). The flag is cleared by writing 1 to the corresponding COFx bit in the DMAMUX_RGCFR register..
Bit 1: Trigger overrun event flag The flag is set when a new trigger event occurs on DMA request generator channel x, before the request counter underrun (the internal request counter programmed via the GNBREQ field of the DMAMUX_RGxCR register). The flag is cleared by writing 1 to the corresponding COFx bit in the DMAMUX_RGCFR register..
Bit 2: Trigger overrun event flag The flag is set when a new trigger event occurs on DMA request generator channel x, before the request counter underrun (the internal request counter programmed via the GNBREQ field of the DMAMUX_RGxCR register). The flag is cleared by writing 1 to the corresponding COFx bit in the DMAMUX_RGCFR register..
Bit 3: Trigger overrun event flag The flag is set when a new trigger event occurs on DMA request generator channel x, before the request counter underrun (the internal request counter programmed via the GNBREQ field of the DMAMUX_RGxCR register). The flag is cleared by writing 1 to the corresponding COFx bit in the DMAMUX_RGCFR register..
DMAMUX request generator interrupt clear flag register
Offset: 0x144, reset: 0x00000000, access: write-only
0/4 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
COF3
w |
COF2
w |
COF1
w |
COF0
w |
||||||||||||
0x50000000: General-purpose I/Os
16/177 fields covered. Toggle Registers
| Offset | Name | 31 |
30 |
29 |
28 |
27 |
26 |
25 |
24 |
23 |
22 |
21 |
20 |
19 |
18 |
17 |
16 |
15 |
14 |
13 |
12 |
11 |
10 |
9 |
8 |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x0 | MODER | ||||||||||||||||||||||||||||||||
| 0x4 | OTYPER | ||||||||||||||||||||||||||||||||
| 0x8 | OSPEEDR | ||||||||||||||||||||||||||||||||
| 0xC | PUPDR | ||||||||||||||||||||||||||||||||
| 0x10 | IDR | ||||||||||||||||||||||||||||||||
| 0x14 | ODR | ||||||||||||||||||||||||||||||||
| 0x18 | BSRR | ||||||||||||||||||||||||||||||||
| 0x1C | LCKR | ||||||||||||||||||||||||||||||||
| 0x20 | AFRL | ||||||||||||||||||||||||||||||||
| 0x24 | AFRH | ||||||||||||||||||||||||||||||||
| 0x28 | BRR | ||||||||||||||||||||||||||||||||
GPIO port bit set/reset register
Offset: 0x18, reset: 0x00000000, access: write-only
0/32 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
BR15
w |
BR14
w |
BR13
w |
BR12
w |
BR11
w |
BR10
w |
BR9
w |
BR8
w |
BR7
w |
BR6
w |
BR5
w |
BR4
w |
BR3
w |
BR2
w |
BR1
w |
BR0
w |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
BS15
w |
BS14
w |
BS13
w |
BS12
w |
BS11
w |
BS10
w |
BS9
w |
BS8
w |
BS7
w |
BS6
w |
BS5
w |
BS4
w |
BS3
w |
BS2
w |
BS1
w |
BS0
w |
0x50000400: General-purpose I/Os
16/177 fields covered. Toggle Registers
| Offset | Name | 31 |
30 |
29 |
28 |
27 |
26 |
25 |
24 |
23 |
22 |
21 |
20 |
19 |
18 |
17 |
16 |
15 |
14 |
13 |
12 |
11 |
10 |
9 |
8 |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x0 | MODER | ||||||||||||||||||||||||||||||||
| 0x4 | OTYPER | ||||||||||||||||||||||||||||||||
| 0x8 | OSPEEDR | ||||||||||||||||||||||||||||||||
| 0xC | PUPDR | ||||||||||||||||||||||||||||||||
| 0x10 | IDR | ||||||||||||||||||||||||||||||||
| 0x14 | ODR | ||||||||||||||||||||||||||||||||
| 0x18 | BSRR | ||||||||||||||||||||||||||||||||
| 0x1C | LCKR | ||||||||||||||||||||||||||||||||
| 0x20 | AFRL | ||||||||||||||||||||||||||||||||
| 0x24 | AFRH | ||||||||||||||||||||||||||||||||
| 0x28 | BRR | ||||||||||||||||||||||||||||||||
GPIO port bit set/reset register
Offset: 0x18, reset: 0x00000000, access: write-only
0/32 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
BR15
w |
BR14
w |
BR13
w |
BR12
w |
BR11
w |
BR10
w |
BR9
w |
BR8
w |
BR7
w |
BR6
w |
BR5
w |
BR4
w |
BR3
w |
BR2
w |
BR1
w |
BR0
w |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
BS15
w |
BS14
w |
BS13
w |
BS12
w |
BS11
w |
BS10
w |
BS9
w |
BS8
w |
BS7
w |
BS6
w |
BS5
w |
BS4
w |
BS3
w |
BS2
w |
BS1
w |
BS0
w |
0x50000800: General-purpose I/Os
16/177 fields covered. Toggle Registers
| Offset | Name | 31 |
30 |
29 |
28 |
27 |
26 |
25 |
24 |
23 |
22 |
21 |
20 |
19 |
18 |
17 |
16 |
15 |
14 |
13 |
12 |
11 |
10 |
9 |
8 |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x0 | MODER | ||||||||||||||||||||||||||||||||
| 0x4 | OTYPER | ||||||||||||||||||||||||||||||||
| 0x8 | OSPEEDR | ||||||||||||||||||||||||||||||||
| 0xC | PUPDR | ||||||||||||||||||||||||||||||||
| 0x10 | IDR | ||||||||||||||||||||||||||||||||
| 0x14 | ODR | ||||||||||||||||||||||||||||||||
| 0x18 | BSRR | ||||||||||||||||||||||||||||||||
| 0x1C | LCKR | ||||||||||||||||||||||||||||||||
| 0x20 | AFRL | ||||||||||||||||||||||||||||||||
| 0x24 | AFRH | ||||||||||||||||||||||||||||||||
| 0x28 | BRR | ||||||||||||||||||||||||||||||||
GPIO port bit set/reset register
Offset: 0x18, reset: 0x00000000, access: write-only
0/32 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
BR15
w |
BR14
w |
BR13
w |
BR12
w |
BR11
w |
BR10
w |
BR9
w |
BR8
w |
BR7
w |
BR6
w |
BR5
w |
BR4
w |
BR3
w |
BR2
w |
BR1
w |
BR0
w |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
BS15
w |
BS14
w |
BS13
w |
BS12
w |
BS11
w |
BS10
w |
BS9
w |
BS8
w |
BS7
w |
BS6
w |
BS5
w |
BS4
w |
BS3
w |
BS2
w |
BS1
w |
BS0
w |
0x50000C00: General-purpose I/Os
16/177 fields covered. Toggle Registers
| Offset | Name | 31 |
30 |
29 |
28 |
27 |
26 |
25 |
24 |
23 |
22 |
21 |
20 |
19 |
18 |
17 |
16 |
15 |
14 |
13 |
12 |
11 |
10 |
9 |
8 |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x0 | MODER | ||||||||||||||||||||||||||||||||
| 0x4 | OTYPER | ||||||||||||||||||||||||||||||||
| 0x8 | OSPEEDR | ||||||||||||||||||||||||||||||||
| 0xC | PUPDR | ||||||||||||||||||||||||||||||||
| 0x10 | IDR | ||||||||||||||||||||||||||||||||
| 0x14 | ODR | ||||||||||||||||||||||||||||||||
| 0x18 | BSRR | ||||||||||||||||||||||||||||||||
| 0x1C | LCKR | ||||||||||||||||||||||||||||||||
| 0x20 | AFRL | ||||||||||||||||||||||||||||||||
| 0x24 | AFRH | ||||||||||||||||||||||||||||||||
| 0x28 | BRR | ||||||||||||||||||||||||||||||||
GPIO port bit set/reset register
Offset: 0x18, reset: 0x00000000, access: write-only
0/32 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
BR15
w |
BR14
w |
BR13
w |
BR12
w |
BR11
w |
BR10
w |
BR9
w |
BR8
w |
BR7
w |
BR6
w |
BR5
w |
BR4
w |
BR3
w |
BR2
w |
BR1
w |
BR0
w |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
BS15
w |
BS14
w |
BS13
w |
BS12
w |
BS11
w |
BS10
w |
BS9
w |
BS8
w |
BS7
w |
BS6
w |
BS5
w |
BS4
w |
BS3
w |
BS2
w |
BS1
w |
BS0
w |
0x50001000: General-purpose I/Os
16/177 fields covered. Toggle Registers
| Offset | Name | 31 |
30 |
29 |
28 |
27 |
26 |
25 |
24 |
23 |
22 |
21 |
20 |
19 |
18 |
17 |
16 |
15 |
14 |
13 |
12 |
11 |
10 |
9 |
8 |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x0 | MODER | ||||||||||||||||||||||||||||||||
| 0x4 | OTYPER | ||||||||||||||||||||||||||||||||
| 0x8 | OSPEEDR | ||||||||||||||||||||||||||||||||
| 0xC | PUPDR | ||||||||||||||||||||||||||||||||
| 0x10 | IDR | ||||||||||||||||||||||||||||||||
| 0x14 | ODR | ||||||||||||||||||||||||||||||||
| 0x18 | BSRR | ||||||||||||||||||||||||||||||||
| 0x1C | LCKR | ||||||||||||||||||||||||||||||||
| 0x20 | AFRL | ||||||||||||||||||||||||||||||||
| 0x24 | AFRH | ||||||||||||||||||||||||||||||||
| 0x28 | BRR | ||||||||||||||||||||||||||||||||
GPIO port bit set/reset register
Offset: 0x18, reset: 0x00000000, access: write-only
0/32 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
BR15
w |
BR14
w |
BR13
w |
BR12
w |
BR11
w |
BR10
w |
BR9
w |
BR8
w |
BR7
w |
BR6
w |
BR5
w |
BR4
w |
BR3
w |
BR2
w |
BR1
w |
BR0
w |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
BS15
w |
BS14
w |
BS13
w |
BS12
w |
BS11
w |
BS10
w |
BS9
w |
BS8
w |
BS7
w |
BS6
w |
BS5
w |
BS4
w |
BS3
w |
BS2
w |
BS1
w |
BS0
w |
0x50001400: General-purpose I/Os
16/177 fields covered. Toggle Registers
| Offset | Name | 31 |
30 |
29 |
28 |
27 |
26 |
25 |
24 |
23 |
22 |
21 |
20 |
19 |
18 |
17 |
16 |
15 |
14 |
13 |
12 |
11 |
10 |
9 |
8 |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x0 | MODER | ||||||||||||||||||||||||||||||||
| 0x4 | OTYPER | ||||||||||||||||||||||||||||||||
| 0x8 | OSPEEDR | ||||||||||||||||||||||||||||||||
| 0xC | PUPDR | ||||||||||||||||||||||||||||||||
| 0x10 | IDR | ||||||||||||||||||||||||||||||||
| 0x14 | ODR | ||||||||||||||||||||||||||||||||
| 0x18 | BSRR | ||||||||||||||||||||||||||||||||
| 0x1C | LCKR | ||||||||||||||||||||||||||||||||
| 0x20 | AFRL | ||||||||||||||||||||||||||||||||
| 0x24 | AFRH | ||||||||||||||||||||||||||||||||
| 0x28 | BRR | ||||||||||||||||||||||||||||||||
GPIO port bit set/reset register
Offset: 0x18, reset: 0x00000000, access: write-only
0/32 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
BR15
w |
BR14
w |
BR13
w |
BR12
w |
BR11
w |
BR10
w |
BR9
w |
BR8
w |
BR7
w |
BR6
w |
BR5
w |
BR4
w |
BR3
w |
BR2
w |
BR1
w |
BR0
w |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
BS15
w |
BS14
w |
BS13
w |
BS12
w |
BS11
w |
BS10
w |
BS9
w |
BS8
w |
BS7
w |
BS6
w |
BS5
w |
BS4
w |
BS3
w |
BS2
w |
BS1
w |
BS0
w |
0x40005400: Inter-integrated circuit
53/76 fields covered. Toggle Registers
| Offset | Name | 31 |
30 |
29 |
28 |
27 |
26 |
25 |
24 |
23 |
22 |
21 |
20 |
19 |
18 |
17 |
16 |
15 |
14 |
13 |
12 |
11 |
10 |
9 |
8 |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x0 | I2C_CR1 | ||||||||||||||||||||||||||||||||
| 0x4 | I2C_CR2 | ||||||||||||||||||||||||||||||||
| 0x8 | I2C_OAR1 | ||||||||||||||||||||||||||||||||
| 0xC | I2C_OAR2 | ||||||||||||||||||||||||||||||||
| 0x10 | I2C_TIMINGR | ||||||||||||||||||||||||||||||||
| 0x14 | I2C_TIMEOUTR | ||||||||||||||||||||||||||||||||
| 0x18 | I2C_ISR | ||||||||||||||||||||||||||||||||
| 0x1C | I2C_ICR | ||||||||||||||||||||||||||||||||
| 0x20 | I2C_PECR | ||||||||||||||||||||||||||||||||
| 0x24 | I2C_RXDR | ||||||||||||||||||||||||||||||||
| 0x28 | I2C_TXDR | ||||||||||||||||||||||||||||||||
Control register 1
Offset: 0x0, reset: 0x00000000, access: read-write
20/20 fields covered.
Bit 0: Peripheral enable Note: When PE=0, the I2C SCL and SDA lines are released. Internal state machines and status bits are put back to their reset value. When cleared, PE must be kept low for at least 3 APB clock cycles..
Allowed values:
0x0: B_0x0: Peripheral disable
0x1: B_0x1: Peripheral enable
Bit 7: Error interrupts enable Note: Any of these errors generate an interrupt: Arbitration Loss (ARLO) Bus Error detection (BERR) Overrun/Underrun (OVR) Timeout detection (TIMEOUT) PEC error detection (PECERR) Alert pin event detection (ALERT).
Allowed values:
0x0: B_0x0: Error detection interrupts disabled
0x1: B_0x1: Error detection interrupts enabled
Bits 8-11: Digital noise filter These bits are used to configure the digital noise filter on SDA and SCL input. The digital filter, filters spikes with a length of up to DNF[3:0] * tI2CCLK ... Note: If the analog filter is also enabled, the digital filter is added to the analog filter. This filter can only be programmed when the I2C is disabled (PE = 0)..
Allowed values:
0x0: B_0x0: Digital filter disabled
0x1: B_0x1: Digital filter enabled and filtering capability up to 1 tI2CCLK
0xF: B_0xF: digital filter enabled and filtering capability up to15 tI2CCLK
Bit 17: Clock stretching disable This bit is used to disable clock stretching in slave mode. It must be kept cleared in master mode. Note: This bit can only be programmed when the I2C is disabled (PE = 0)..
Allowed values:
0x0: B_0x0: Clock stretching enabled
0x1: B_0x1: Clock stretching disabled
Bit 18: Wakeup from Stop mode enable Note: If the Wakeup from Stop mode feature is not supported, this bit is reserved and forced by hardware to '0â. Refer to . Note: WUPEN can be set only when DNF = '0000â.
Allowed values:
0x0: B_0x0: Wakeup from Stop mode disable.
0x1: B_0x1: Wakeup from Stop mode enable.
Bit 21: SMBus Device Default Address enable Note: If the SMBus feature is not supported, this bit is reserved and forced by hardware to '0â. Refer to ..
Allowed values:
0x0: B_0x0: Device Default Address disabled. Address 0b1100001x is NACKed.
0x1: B_0x1: Device Default Address enabled. Address 0b1100001x is ACKed.
Bit 22: SMBus alert enable Note: When ALERTEN=0, the SMBA pin can be used as a standard GPIO. If the SMBus feature is not supported, this bit is reserved and forced by hardware to '0â. Refer to ..
Allowed values:
0x0: B_0x0: The SMBus alert pin (SMBA) is not supported in host mode (SMBHEN=1). In device mode (SMBHEN=0), the SMBA pin is released and the Alert Response Address header is disabled (0001100x followed by NACK).
0x1: B_0x1: The SMBus alert pin is supported in host mode (SMBHEN=1). In device mode (SMBHEN=0), the SMBA pin is driven low and the Alert Response Address header is enabled (0001100x followed by ACK).
Control register 2
Offset: 0x4, reset: 0x00000000, access: read-write
9/11 fields covered.
Bits 0-9: Slave address (master mode) In 7-bit addressing mode (ADD10 = 0): SADD[7:1] should be written with the 7-bit slave address to be sent. The bits SADD[9], SADD[8] and SADD[0] are don't care. In 10-bit addressing mode (ADD10 = 1): SADD[9:0] should be written with the 10-bit slave address to be sent. Note: Changing these bits when the START bit is set is not allowed..
Bit 12: 10-bit address header only read direction (master receiver mode) Note: Changing this bit when the START bit is set is not allowed..
Allowed values:
0x0: B_0x0: The master sends the complete 10 bit slave address read sequence: Start + 2 bytes 10bit address in write direction + Restart + 1st 7 bits of the 10 bit address in read direction.
0x1: B_0x1: The master only sends the 1st 7 bits of the 10 bit address, followed by Read direction.
Bit 13: Start generation This bit is set by software, and cleared by hardware after the Start followed by the address sequence is sent, by an arbitration loss, by a timeout error detection, or when PE = 0. It can also be cleared by software by writing '1â to the ADDRCF bit in the I2C_ICR register. If the I2C is already in master mode with AUTOEND = 0, setting this bit generates a Repeated Start condition when RELOAD=0, after the end of the NBYTES transfer. Otherwise setting this bit generates a START condition once the bus is free. Note: Writing '0â to this bit has no effect. The START bit can be set even if the bus is BUSY or I2C is in slave mode. This bit has no effect when RELOAD is set..
Allowed values:
0x0: B_0x0: No Start generation.
0x1: B_0x1: Restart/Start generation:
Bit 14: Stop generation (master mode) The bit is set by software, cleared by hardware when a STOP condition is detected, or when PE = 0. In Master Mode: Note: Writing '0â to this bit has no effect..
Allowed values:
0x0: B_0x0: No Stop generation.
0x1: B_0x1: Stop generation after current byte transfer.
Bit 15: NACK generation (slave mode) The bit is set by software, cleared by hardware when the NACK is sent, or when a STOP condition or an Address matched is received, or when PE=0. Note: Writing '0â to this bit has no effect. This bit is used in slave mode only: in master receiver mode, NACK is automatically generated after last byte preceding STOP or RESTART condition, whatever the NACK bit value. When an overrun occurs in slave receiver NOSTRETCH mode, a NACK is automatically generated whatever the NACK bit value. When hardware PEC checking is enabled (PECBYTE=1), the PEC acknowledge value does not depend on the NACK value..
Allowed values:
0x0: B_0x0: an ACK is sent after current received byte.
0x1: B_0x1: a NACK is sent after current received byte.
Bit 24: NBYTES reload mode This bit is set and cleared by software..
Allowed values:
0x0: B_0x0: The transfer is completed after the NBYTES data transfer (STOP or RESTART follows).
0x1: B_0x1: The transfer is not completed after the NBYTES data transfer (NBYTES is reloaded). TCR flag is set when NBYTES data are transferred, stretching SCL low.
Bit 25: Automatic end mode (master mode) This bit is set and cleared by software. Note: This bit has no effect in slave mode or when the RELOAD bit is set..
Allowed values:
0x0: B_0x0: software end mode: TC flag is set when NBYTES data are transferred, stretching SCL low.
0x1: B_0x1: Automatic end mode: a STOP condition is automatically sent when NBYTES data are transferred.
Bit 26: Packet error checking byte This bit is set by software, and cleared by hardware when the PEC is transferred, or when a STOP condition or an Address matched is received, also when PE=0. Note: Writing '0â to this bit has no effect. This bit has no effect when RELOAD is set. This bit has no effect is slave mode when SBC=0. If the SMBus feature is not supported, this bit is reserved and forced by hardware to '0â. Refer to ..
Allowed values:
0x0: B_0x0: No PEC transfer.
0x1: B_0x1: PEC transmission/reception is requested
Own address register 1
Offset: 0x8, reset: 0x00000000, access: read-write
2/3 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
OA1EN
rw |
OA1MODE
rw |
OA1
rw |
|||||||||||||
Own address register 2
Offset: 0xC, reset: 0x00000000, access: read-write
2/3 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
OA2EN
rw |
OA2MSK
rw |
OA2
rw |
|||||||||||||
Bits 8-10: Own Address 2 masks Note: These bits can be written only when OA2EN=0. As soon as OA2MSK is not equal to 0, the reserved I2C addresses (0b0000xxx and 0b1111xxx) are not acknowledged even if the comparison matches..
Allowed values:
0x0: B_0x0: No mask
0x1: B_0x1: OA2[1] is masked and donât care. Only OA2[7:2] are compared.
0x2: B_0x2: OA2[2:1] are masked and donât care. Only OA2[7:3] are compared.
0x3: B_0x3: OA2[3:1] are masked and donât care. Only OA2[7:4] are compared.
0x4: B_0x4: OA2[4:1] are masked and donât care. Only OA2[7:5] are compared.
0x5: B_0x5: OA2[5:1] are masked and donât care. Only OA2[7:6] are compared.
0x6: B_0x6: OA2[6:1] are masked and donât care. Only OA2[7] is compared.
0x7: B_0x7: OA2[7:1] are masked and donât care. No comparison is done, and all (except reserved) 7-bit received addresses are acknowledged.
Status register 1
Offset: 0x14, reset: 0x00000000, access: read-write
3/5 fields covered.
Bits 0-11: Bus Timeout A This field is used to configure: The SCL low timeout condition tTIMEOUT when TIDLE=0 tTIMEOUT= (TIMEOUTA+1) x 2048 x tI2CCLK The bus idle condition (both SCL and SDA high) when TIDLE=1 tIDLE= (TIMEOUTA+1) x 4 x tI2CCLK Note: These bits can be written only when TIMOUTEN=0..
Bits 16-27: Bus timeout B This field is used to configure the cumulative clock extension timeout: In master mode, the master cumulative clock low extend time (tLOW:MEXT) is detected In slave mode, the slave cumulative clock low extend time (tLOW:SEXT) is detected tLOW:EXT= (TIMEOUTB+1) x 2048 x tI2CCLK Note: These bits can be written only when TEXTEN=0..
PEC register
Offset: 0x20, reset: 0x00000000, access: read-only
1/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
PEC
r |
|||||||||||||||
Receive data register
Offset: 0x24, reset: 0x00000000, access: read-only
1/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
RXDATA
r |
|||||||||||||||
Transmit data register
Offset: 0x28, reset: 0x00000000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
TXDATA
rw |
|||||||||||||||
0x40005800: Inter-integrated circuit
53/76 fields covered. Toggle Registers
| Offset | Name | 31 |
30 |
29 |
28 |
27 |
26 |
25 |
24 |
23 |
22 |
21 |
20 |
19 |
18 |
17 |
16 |
15 |
14 |
13 |
12 |
11 |
10 |
9 |
8 |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x0 | I2C_CR1 | ||||||||||||||||||||||||||||||||
| 0x4 | I2C_CR2 | ||||||||||||||||||||||||||||||||
| 0x8 | I2C_OAR1 | ||||||||||||||||||||||||||||||||
| 0xC | I2C_OAR2 | ||||||||||||||||||||||||||||||||
| 0x10 | I2C_TIMINGR | ||||||||||||||||||||||||||||||||
| 0x14 | I2C_TIMEOUTR | ||||||||||||||||||||||||||||||||
| 0x18 | I2C_ISR | ||||||||||||||||||||||||||||||||
| 0x1C | I2C_ICR | ||||||||||||||||||||||||||||||||
| 0x20 | I2C_PECR | ||||||||||||||||||||||||||||||||
| 0x24 | I2C_RXDR | ||||||||||||||||||||||||||||||||
| 0x28 | I2C_TXDR | ||||||||||||||||||||||||||||||||
Control register 1
Offset: 0x0, reset: 0x00000000, access: read-write
20/20 fields covered.
Bit 0: Peripheral enable Note: When PE=0, the I2C SCL and SDA lines are released. Internal state machines and status bits are put back to their reset value. When cleared, PE must be kept low for at least 3 APB clock cycles..
Allowed values:
0x0: B_0x0: Peripheral disable
0x1: B_0x1: Peripheral enable
Bit 7: Error interrupts enable Note: Any of these errors generate an interrupt: Arbitration Loss (ARLO) Bus Error detection (BERR) Overrun/Underrun (OVR) Timeout detection (TIMEOUT) PEC error detection (PECERR) Alert pin event detection (ALERT).
Allowed values:
0x0: B_0x0: Error detection interrupts disabled
0x1: B_0x1: Error detection interrupts enabled
Bits 8-11: Digital noise filter These bits are used to configure the digital noise filter on SDA and SCL input. The digital filter, filters spikes with a length of up to DNF[3:0] * tI2CCLK ... Note: If the analog filter is also enabled, the digital filter is added to the analog filter. This filter can only be programmed when the I2C is disabled (PE = 0)..
Allowed values:
0x0: B_0x0: Digital filter disabled
0x1: B_0x1: Digital filter enabled and filtering capability up to 1 tI2CCLK
0xF: B_0xF: digital filter enabled and filtering capability up to15 tI2CCLK
Bit 17: Clock stretching disable This bit is used to disable clock stretching in slave mode. It must be kept cleared in master mode. Note: This bit can only be programmed when the I2C is disabled (PE = 0)..
Allowed values:
0x0: B_0x0: Clock stretching enabled
0x1: B_0x1: Clock stretching disabled
Bit 18: Wakeup from Stop mode enable Note: If the Wakeup from Stop mode feature is not supported, this bit is reserved and forced by hardware to '0â. Refer to . Note: WUPEN can be set only when DNF = '0000â.
Allowed values:
0x0: B_0x0: Wakeup from Stop mode disable.
0x1: B_0x1: Wakeup from Stop mode enable.
Bit 21: SMBus Device Default Address enable Note: If the SMBus feature is not supported, this bit is reserved and forced by hardware to '0â. Refer to ..
Allowed values:
0x0: B_0x0: Device Default Address disabled. Address 0b1100001x is NACKed.
0x1: B_0x1: Device Default Address enabled. Address 0b1100001x is ACKed.
Bit 22: SMBus alert enable Note: When ALERTEN=0, the SMBA pin can be used as a standard GPIO. If the SMBus feature is not supported, this bit is reserved and forced by hardware to '0â. Refer to ..
Allowed values:
0x0: B_0x0: The SMBus alert pin (SMBA) is not supported in host mode (SMBHEN=1). In device mode (SMBHEN=0), the SMBA pin is released and the Alert Response Address header is disabled (0001100x followed by NACK).
0x1: B_0x1: The SMBus alert pin is supported in host mode (SMBHEN=1). In device mode (SMBHEN=0), the SMBA pin is driven low and the Alert Response Address header is enabled (0001100x followed by ACK).
Control register 2
Offset: 0x4, reset: 0x00000000, access: read-write
9/11 fields covered.
Bits 0-9: Slave address (master mode) In 7-bit addressing mode (ADD10 = 0): SADD[7:1] should be written with the 7-bit slave address to be sent. The bits SADD[9], SADD[8] and SADD[0] are don't care. In 10-bit addressing mode (ADD10 = 1): SADD[9:0] should be written with the 10-bit slave address to be sent. Note: Changing these bits when the START bit is set is not allowed..
Bit 12: 10-bit address header only read direction (master receiver mode) Note: Changing this bit when the START bit is set is not allowed..
Allowed values:
0x0: B_0x0: The master sends the complete 10 bit slave address read sequence: Start + 2 bytes 10bit address in write direction + Restart + 1st 7 bits of the 10 bit address in read direction.
0x1: B_0x1: The master only sends the 1st 7 bits of the 10 bit address, followed by Read direction.
Bit 13: Start generation This bit is set by software, and cleared by hardware after the Start followed by the address sequence is sent, by an arbitration loss, by a timeout error detection, or when PE = 0. It can also be cleared by software by writing '1â to the ADDRCF bit in the I2C_ICR register. If the I2C is already in master mode with AUTOEND = 0, setting this bit generates a Repeated Start condition when RELOAD=0, after the end of the NBYTES transfer. Otherwise setting this bit generates a START condition once the bus is free. Note: Writing '0â to this bit has no effect. The START bit can be set even if the bus is BUSY or I2C is in slave mode. This bit has no effect when RELOAD is set..
Allowed values:
0x0: B_0x0: No Start generation.
0x1: B_0x1: Restart/Start generation:
Bit 14: Stop generation (master mode) The bit is set by software, cleared by hardware when a STOP condition is detected, or when PE = 0. In Master Mode: Note: Writing '0â to this bit has no effect..
Allowed values:
0x0: B_0x0: No Stop generation.
0x1: B_0x1: Stop generation after current byte transfer.
Bit 15: NACK generation (slave mode) The bit is set by software, cleared by hardware when the NACK is sent, or when a STOP condition or an Address matched is received, or when PE=0. Note: Writing '0â to this bit has no effect. This bit is used in slave mode only: in master receiver mode, NACK is automatically generated after last byte preceding STOP or RESTART condition, whatever the NACK bit value. When an overrun occurs in slave receiver NOSTRETCH mode, a NACK is automatically generated whatever the NACK bit value. When hardware PEC checking is enabled (PECBYTE=1), the PEC acknowledge value does not depend on the NACK value..
Allowed values:
0x0: B_0x0: an ACK is sent after current received byte.
0x1: B_0x1: a NACK is sent after current received byte.
Bit 24: NBYTES reload mode This bit is set and cleared by software..
Allowed values:
0x0: B_0x0: The transfer is completed after the NBYTES data transfer (STOP or RESTART follows).
0x1: B_0x1: The transfer is not completed after the NBYTES data transfer (NBYTES is reloaded). TCR flag is set when NBYTES data are transferred, stretching SCL low.
Bit 25: Automatic end mode (master mode) This bit is set and cleared by software. Note: This bit has no effect in slave mode or when the RELOAD bit is set..
Allowed values:
0x0: B_0x0: software end mode: TC flag is set when NBYTES data are transferred, stretching SCL low.
0x1: B_0x1: Automatic end mode: a STOP condition is automatically sent when NBYTES data are transferred.
Bit 26: Packet error checking byte This bit is set by software, and cleared by hardware when the PEC is transferred, or when a STOP condition or an Address matched is received, also when PE=0. Note: Writing '0â to this bit has no effect. This bit has no effect when RELOAD is set. This bit has no effect is slave mode when SBC=0. If the SMBus feature is not supported, this bit is reserved and forced by hardware to '0â. Refer to ..
Allowed values:
0x0: B_0x0: No PEC transfer.
0x1: B_0x1: PEC transmission/reception is requested
Own address register 1
Offset: 0x8, reset: 0x00000000, access: read-write
2/3 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
OA1EN
rw |
OA1MODE
rw |
OA1
rw |
|||||||||||||
Own address register 2
Offset: 0xC, reset: 0x00000000, access: read-write
2/3 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
OA2EN
rw |
OA2MSK
rw |
OA2
rw |
|||||||||||||
Bits 8-10: Own Address 2 masks Note: These bits can be written only when OA2EN=0. As soon as OA2MSK is not equal to 0, the reserved I2C addresses (0b0000xxx and 0b1111xxx) are not acknowledged even if the comparison matches..
Allowed values:
0x0: B_0x0: No mask
0x1: B_0x1: OA2[1] is masked and donât care. Only OA2[7:2] are compared.
0x2: B_0x2: OA2[2:1] are masked and donât care. Only OA2[7:3] are compared.
0x3: B_0x3: OA2[3:1] are masked and donât care. Only OA2[7:4] are compared.
0x4: B_0x4: OA2[4:1] are masked and donât care. Only OA2[7:5] are compared.
0x5: B_0x5: OA2[5:1] are masked and donât care. Only OA2[7:6] are compared.
0x6: B_0x6: OA2[6:1] are masked and donât care. Only OA2[7] is compared.
0x7: B_0x7: OA2[7:1] are masked and donât care. No comparison is done, and all (except reserved) 7-bit received addresses are acknowledged.
Status register 1
Offset: 0x14, reset: 0x00000000, access: read-write
3/5 fields covered.
Bits 0-11: Bus Timeout A This field is used to configure: The SCL low timeout condition tTIMEOUT when TIDLE=0 tTIMEOUT= (TIMEOUTA+1) x 2048 x tI2CCLK The bus idle condition (both SCL and SDA high) when TIDLE=1 tIDLE= (TIMEOUTA+1) x 4 x tI2CCLK Note: These bits can be written only when TIMOUTEN=0..
Bits 16-27: Bus timeout B This field is used to configure the cumulative clock extension timeout: In master mode, the master cumulative clock low extend time (tLOW:MEXT) is detected In slave mode, the slave cumulative clock low extend time (tLOW:SEXT) is detected tLOW:EXT= (TIMEOUTB+1) x 2048 x tI2CCLK Note: These bits can be written only when TEXTEN=0..
PEC register
Offset: 0x20, reset: 0x00000000, access: read-only
1/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
PEC
r |
|||||||||||||||
Receive data register
Offset: 0x24, reset: 0x00000000, access: read-only
1/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
RXDATA
r |
|||||||||||||||
Transmit data register
Offset: 0x28, reset: 0x00000000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
TXDATA
rw |
|||||||||||||||
0x40003000: Independent watchdog
4/7 fields covered. Toggle Registers
| Offset | Name | 31 |
30 |
29 |
28 |
27 |
26 |
25 |
24 |
23 |
22 |
21 |
20 |
19 |
18 |
17 |
16 |
15 |
14 |
13 |
12 |
11 |
10 |
9 |
8 |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x0 | IWDG_KR | ||||||||||||||||||||||||||||||||
| 0x4 | IWDG_PR | ||||||||||||||||||||||||||||||||
| 0x8 | IWDG_RLR | ||||||||||||||||||||||||||||||||
| 0xC | IWDG_SR | ||||||||||||||||||||||||||||||||
| 0x10 | IWDG_WINR | ||||||||||||||||||||||||||||||||
Key register
Offset: 0x0, reset: 0x00000000, access: write-only
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
KEY
w |
|||||||||||||||
Prescaler register
Offset: 0x4, reset: 0x00000000, access: read-write
1/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
PR
rw |
|||||||||||||||
Bits 0-2: Prescaler divider These bits are write access protected see . They are written by software to select the prescaler divider feeding the counter clock. PVU bit of the must be reset in order to be able to change the prescaler divider. Note: Reading this register returns the prescaler value from the VDD voltage domain. This value may not be up to date/valid if a write operation to this register is ongoing. For this reason the value read from this register is valid only when the PVU bit in the status register (IWDG_SR) is reset..
Allowed values:
0x0: B_0x0: divider /4
0x1: B_0x1: divider /8
0x2: B_0x2: divider /16
0x3: B_0x3: divider /32
0x4: B_0x4: divider /64
0x5: B_0x5: divider /128
0x6: B_0x6: divider /256
0x7: B_0x7: divider /256
Reload register
Offset: 0x8, reset: 0x00000FFF, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
RL
rw |
|||||||||||||||
Status register
Offset: 0xC, reset: 0x00000000, access: read-only
3/3 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
WVU
r |
RVU
r |
PVU
r |
|||||||||||||
Bit 0: Watchdog prescaler value update This bit is set by hardware to indicate that an update of the prescaler value is ongoing. It is reset by hardware when the prescaler update operation is completed in the VDD voltage domain (takes up to five LSI cycles). Prescaler value can be updated only when PVU bit is reset..
Bit 1: Watchdog counter reload value update This bit is set by hardware to indicate that an update of the reload value is ongoing. It is reset by hardware when the reload value update operation is completed in the VDD voltage domain (takes up to five LSI cycles). Reload value can be updated only when RVU bit is reset..
Bit 2: Watchdog counter window value update This bit is set by hardware to indicate that an update of the window value is ongoing. It is reset by hardware when the reload value update operation is completed in the VDD voltage domain (takes up to five LSI cycles). Window value can be updated only when WVU bit is reset..
Window register
Offset: 0x10, reset: 0x00000FFF, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
WIN
rw |
|||||||||||||||
0x40012C00: Advanced-timers
116/190 fields covered. Toggle Registers
| Offset | Name | 31 |
30 |
29 |
28 |
27 |
26 |
25 |
24 |
23 |
22 |
21 |
20 |
19 |
18 |
17 |
16 |
15 |
14 |
13 |
12 |
11 |
10 |
9 |
8 |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x0 | CR1 | ||||||||||||||||||||||||||||||||
| 0x4 | CR2 | ||||||||||||||||||||||||||||||||
| 0x8 | SMCR | ||||||||||||||||||||||||||||||||
| 0xC | DIER | ||||||||||||||||||||||||||||||||
| 0x10 | SR | ||||||||||||||||||||||||||||||||
| 0x14 | EGR | ||||||||||||||||||||||||||||||||
| 0x18 | CCMR1_Input | ||||||||||||||||||||||||||||||||
| 0x18 | CCMR1_Output | ||||||||||||||||||||||||||||||||
| 0x1C | CCMR2_Input | ||||||||||||||||||||||||||||||||
| 0x1C | CCMR2_Output | ||||||||||||||||||||||||||||||||
| 0x20 | CCER | ||||||||||||||||||||||||||||||||
| 0x24 | CNT | ||||||||||||||||||||||||||||||||
| 0x28 | PSC | ||||||||||||||||||||||||||||||||
| 0x2C | ARR | ||||||||||||||||||||||||||||||||
| 0x30 | RCR | ||||||||||||||||||||||||||||||||
| 0x34 | CCR1 | ||||||||||||||||||||||||||||||||
| 0x38 | CCR2 | ||||||||||||||||||||||||||||||||
| 0x3C | CCR3 | ||||||||||||||||||||||||||||||||
| 0x40 | CCR4 | ||||||||||||||||||||||||||||||||
| 0x44 | BDTR | ||||||||||||||||||||||||||||||||
| 0x48 | DCR | ||||||||||||||||||||||||||||||||
| 0x4C | DMAR | ||||||||||||||||||||||||||||||||
| 0x50 | OR1 | ||||||||||||||||||||||||||||||||
| 0x54 | CCMR3_Output | ||||||||||||||||||||||||||||||||
| 0x58 | CCR5 | ||||||||||||||||||||||||||||||||
| 0x5C | CCR6 | ||||||||||||||||||||||||||||||||
| 0x60 | AF1 | ||||||||||||||||||||||||||||||||
| 0x64 | AF2 | ||||||||||||||||||||||||||||||||
| 0x68 | TISEL | ||||||||||||||||||||||||||||||||
control register 1
Offset: 0x0, reset: 0x00000000, access: read-write
9/9 fields covered.
Bit 1: Update disable This bit is set and cleared by software to enable/disable UEV event generation. Counter overflow/underflow Setting the UG bit Update generation through the slave mode controller Buffered registers are then loaded with their preload values..
Allowed values:
0x0: B_0x0: UEV enabled. The Update (UEV) event is generated by one of the following events:
0x1: B_0x1: UEV disabled. The Update event is not generated, shadow registers keep their value (ARR, PSC, CCRx). However the counter and the prescaler are reinitialized if the UG bit is set or if a hardware reset is received from the slave mode controller.
Bit 2: Update request source This bit is set and cleared by software to select the UEV event sources. Counter overflow/underflow Setting the UG bit Update generation through the slave mode controller.
Allowed values:
0x0: B_0x0: Any of the following events generate an update interrupt or DMA request if enabled. These events can be:
0x1: B_0x1: Only counter overflow/underflow generates an update interrupt or DMA request if enabled.
Bits 5-6: Center-aligned mode selection Note: Switch from edge-aligned mode to center-aligned mode as long as the counter is enabled (CEN=1) is not allowed.
Allowed values:
0x0: B_0x0: Edge-aligned mode. The counter counts up or down depending on the direction bit (DIR).
0x1: B_0x1: Center-aligned mode 1. The counter counts up and down alternatively. Output compare interrupt flags of channels configured in output (CCxS=00 in TIMx_CCMRx register) are set only when the counter is counting down.
0x2: B_0x2: Center-aligned mode 2. The counter counts up and down alternatively. Output compare interrupt flags of channels configured in output (CCxS=00 in TIMx_CCMRx register) are set only when the counter is counting up.
0x3: B_0x3: Center-aligned mode 3. The counter counts up and down alternatively. Output compare interrupt flags of channels configured in output (CCxS=00 in TIMx_CCMRx register) are set both when the counter is counting up or down.
Bits 8-9: Clock division This bit-field indicates the division ratio between the timer clock (CK_INT) frequency and the dead-time and sampling clock (tDTS)used by the dead-time generators and the digital filters (ETR, TIx): Note: tDTS = 1/fDTS, tCK_INT = 1/fCK_INT..
Allowed values:
0x0: B_0x0: tDTS=tCK_INT
0x1: B_0x1: tDTS=2*tCK_INT
0x2: B_0x2: tDTS=4*tCK_INT
0x3: B_0x3: Reserved, do not program this value
control register 2
Offset: 0x4, reset: 0x00000000, access: read-write
8/15 fields covered.
Bit 0: Capture/compare preloaded control Note: This bit acts only on channels that have a complementary output..
Allowed values:
0x0: B_0x0: CCxE, CCxNE and OCxM bits are not preloaded
0x1: B_0x1: CCxE, CCxNE and OCxM bits are preloaded, after having been written, they are updated only when a commutation event (COM) occurs (COMG bit set or rising edge detected on TRGI, depending on the CCUS bit).
Bit 2: Capture/compare control update selection Note: This bit acts only on channels that have a complementary output..
Allowed values:
0x0: B_0x0: When capture/compare control bits are preloaded (CCPC=1), they are updated by setting the COMG bit only
0x1: B_0x1: When capture/compare control bits are preloaded (CCPC=1), they are updated by setting the COMG bit or when an rising edge occurs on TRGI
Bits 4-6: Master mode selection These bits allow selected information to be sent in master mode to slave timers for synchronization (TRGO). The combination is as follows: Note: The clock of the slave timer or ADC must be enabled prior to receive events from the master timer, and must not be changed on-the-fly while triggers are received from the master timer..
Allowed values:
0x0: B_0x0: Reset - the UG bit from the TIMx_EGR register is used as trigger output (TRGO). If the reset is generated by the trigger input (slave mode controller configured in reset mode) then the signal on TRGO is delayed compared to the actual reset.
0x1: B_0x1: Enable - the Counter Enable signal CNT_EN is used as trigger output (TRGO). It is useful to start several timers at the same time or to control a window in which a slave timer is enable. The Counter Enable signal is generated by a logic AND between CEN control bit and the trigger input when configured in gated mode. When the Counter Enable signal is controlled by the trigger input, there is a delay on TRGO, except if the master/slave mode is selected (see the MSM bit description in TIMx_SMCR register).
0x2: B_0x2: Update - The update event is selected as trigger output (TRGO). For instance a master timer can then be used as a prescaler for a slave timer.
0x3: B_0x3: Compare Pulse - The trigger output send a positive pulse when the CC1IF flag is to be set (even if it was already high), as soon as a capture or a compare match occurred. (TRGO).
0x4: B_0x4: Compare - OC1REFC signal is used as trigger output (TRGO)
0x5: B_0x5: Compare - OC2REFC signal is used as trigger output (TRGO)
0x6: B_0x6: Compare - OC3REFC signal is used as trigger output (TRGO)
0x7: B_0x7: Compare - OC4REFC signal is used as trigger output (TRGO)
Bit 8: Output Idle state 1 (OC1 output) Note: This bit can not be modified as long as LOCK level 1, 2 or 3 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: OC1=0 (after a dead-time if OC1N is implemented) when MOE=0
0x1: B_0x1: OC1=1 (after a dead-time if OC1N is implemented) when MOE=0
Bits 20-23: Master mode selection 2 These bits allow the information to be sent to ADC for synchronization (TRGO2) to be selected. The combination is as follows: Note: The clock of the slave timer or ADC must be enabled prior to receive events from the master timer, and must not be changed on-the-fly while triggers are received from the master timer..
Allowed values:
0x0: B_0x0: Reset - the UG bit from the TIMx_EGR register is used as trigger output (TRGO2). If the reset is generated by the trigger input (slave mode controller configured in reset mode), the signal on TRGO2 is delayed compared to the actual reset.
0x1: B_0x1: Enable - the Counter Enable signal CNT_EN is used as trigger output (TRGO2). It is useful to start several timers at the same time or to control a window in which a slave timer is enabled. The Counter Enable signal is generated by a logic AND between the CEN control bit and the trigger input when configured in Gated mode. When the Counter Enable signal is controlled by the trigger input, there is a delay on TRGO2, except if the Master/Slave mode is selected (see the MSM bit description in TIMx_SMCR register).
0x2: B_0x2: Update - the update event is selected as trigger output (TRGO2). For instance, a master timer can then be used as a prescaler for a slave timer.
0x3: B_0x3: Compare pulse - the trigger output sends a positive pulse when the CC1IF flag is to be set (even if it was already high), as soon as a capture or compare match occurs (TRGO2).
0x4: B_0x4: Compare - OC1REFC signal is used as trigger output (TRGO2)
0x5: B_0x5: Compare - OC2REFC signal is used as trigger output (TRGO2)
0x6: B_0x6: Compare - OC3REFC signal is used as trigger output (TRGO2)
0x7: B_0x7: Compare - OC4REFC signal is used as trigger output (TRGO2)
0x8: B_0x8: Compare - OC5REFC signal is used as trigger output (TRGO2)
0x9: B_0x9: Compare - OC6REFC signal is used as trigger output (TRGO2)
0xA: B_0xA: Compare Pulse - OC4REFC rising or falling edges generate pulses on TRGO2
0xB: B_0xB: Compare Pulse - OC6REFC rising or falling edges generate pulses on TRGO2
0xC: B_0xC: Compare Pulse - OC4REFC or OC6REFC rising edges generate pulses on TRGO2
0xD: B_0xD: Compare Pulse - OC4REFC rising or OC6REFC falling edges generate pulses on TRGO2
0xE: B_0xE: Compare Pulse - OC5REFC or OC6REFC rising edges generate pulses on TRGO2
0xF: B_0xF: Compare Pulse - OC5REFC rising or OC6REFC falling edges generate pulses on TRGO2
slave mode control register
Offset: 0x8, reset: 0x00000000, access: read-write
6/10 fields covered.
Bits 0-2: Slave mode selection When external signals are selected the active edge of the trigger signal (TRGI) is linked to the polarity selected on the external input (see Input Control register and Control Register description. Note: The gated mode must not be used if TI1F_ED is selected as the trigger input (TS=00100). Indeed, TI1F_ED outputs 1 pulse for each transition on TI1F, whereas the gated mode checks the level of the trigger signal. Note: The clock of the slave peripherals (timer, ADC, ...) receiving the TRGO or the TRGO2 signals must be enabled prior to receive events from the master timer, and the clock frequency (prescaler) must not be changed on-the-fly while triggers are received from the master timer..
Bits 4-6: Trigger selection This bit-field selects the trigger input to be used to synchronize the counter. Others: Reserved See for more details on ITRx meaning for each Timer. Note: These bits must be changed only when they are not used (e.g. when SMS=000) to avoid wrong edge detections at the transition..
Bit 7: Master/slave mode.
Allowed values:
0x0: B_0x0: No action
0x1: B_0x1: The effect of an event on the trigger input (TRGI) is delayed to allow a perfect synchronization between the current timer and its slaves (through TRGO). It is useful if we want to synchronize several timers on a single external event.
Bits 8-11: External trigger filter This bit-field then defines the frequency used to sample ETRP signal and the length of the digital filter applied to ETRP. The digital filter is made of an event counter in which N consecutive events are needed to validate a transition on the output:.
Allowed values:
0x0: B_0x0: No filter, sampling is done at fDTS
0x1: B_0x1: fSAMPLING=fCK_INT, N=2
0x2: B_0x2: fSAMPLING=fCK_INT, N=4
0x3: B_0x3: fSAMPLING=fCK_INT, N=8
0x4: B_0x4: fSAMPLING=fDTS/2, N=6
0x5: B_0x5: fSAMPLING=fDTS/2, N=8
0x6: B_0x6: fSAMPLING=fDTS/4, N=6
0x7: B_0x7: fSAMPLING=fDTS/4, N=8
0x8: B_0x8: fSAMPLING=fDTS/8, N=6
0x9: B_0x9: fSAMPLING=fDTS/8, N=8
0xA: B_0xA: fSAMPLING=fDTS/16, N=5
0xB: B_0xB: fSAMPLING=fDTS/16, N=6
0xC: B_0xC: fSAMPLING=fDTS/16, N=8
0xD: B_0xD: fSAMPLING=fDTS/32, N=5
0xE: B_0xE: fSAMPLING=fDTS/32, N=6
0xF: B_0xF: fSAMPLING=fDTS/32, N=8
Bits 12-13: External trigger prescaler External trigger signal ETRP frequency must be at most 1/4 of fCK_INT frequency. A prescaler can be enabled to reduce ETRP frequency. It is useful when inputting fast external clocks..
Allowed values:
0x0: B_0x0: Prescaler OFF
0x1: B_0x1: ETRP frequency divided by 2
0x2: B_0x2: ETRP frequency divided by 4
0x3: B_0x3: ETRP frequency divided by 8
Bit 14: External clock enable This bit enables External clock mode 2. Note: Setting the ECE bit has the same effect as selecting external clock mode 1 with TRGI connected to ETRF (SMS=111 and TS=00111). It is possible to simultaneously use external clock mode 2 with the following slave modes: reset mode, gated mode and trigger mode. Nevertheless, TRGI must not be connected to ETRF in this case (TS bits must not be 00111). If external clock mode 1 and external clock mode 2 are enabled at the same time, the external clock input is ETRF..
Allowed values:
0x0: B_0x0: External clock mode 2 disabled
0x1: B_0x1: External clock mode 2 enabled. The counter is clocked by any active edge on the ETRF signal.
Bit 16: Slave mode selection When external signals are selected the active edge of the trigger signal (TRGI) is linked to the polarity selected on the external input (see Input Control register and Control Register description. Note: The gated mode must not be used if TI1F_ED is selected as the trigger input (TS=00100). Indeed, TI1F_ED outputs 1 pulse for each transition on TI1F, whereas the gated mode checks the level of the trigger signal. Note: The clock of the slave peripherals (timer, ADC, ...) receiving the TRGO or the TRGO2 signals must be enabled prior to receive events from the master timer, and the clock frequency (prescaler) must not be changed on-the-fly while triggers are received from the master timer..
Bits 20-21: Trigger selection This bit-field selects the trigger input to be used to synchronize the counter. Others: Reserved See for more details on ITRx meaning for each Timer. Note: These bits must be changed only when they are not used (e.g. when SMS=000) to avoid wrong edge detections at the transition..
status register
Offset: 0x10, reset: 0x0000, access: read-write
8/16 fields covered.
Bit 0: Update interrupt flag This bit is set by hardware on an update event. It is cleared by software. At overflow or underflow regarding the repetition counter value (update if repetition counter = 0) and if the UDIS=0 in the TIMx_CR1 register. When CNT is reinitialized by software using the UG bit in TIMx_EGR register, if URS=0 and UDIS=0 in the TIMx_CR1 register. When CNT is reinitialized by a trigger event (refer to control register (TIM1_SMCRTIMx_SMCR)N/A), if URS=0 and UDIS=0 in the TIMx_CR1 register..
Allowed values:
0x0: B_0x0: No update occurred.
0x1: B_0x1: Update interrupt pending. This bit is set by hardware when the registers are updated:
Bit 1: Capture/Compare 1 interrupt flag This flag is set by hardware. It is cleared by software (input capture or output compare mode) or by reading the TIMx_CCR1 register (input capture mode only). If channel CC1 is configured as output: this flag is set when he content of the counter TIMx_CNT matches the content of the TIMx_CCR1 register. When the content of TIMx_CCR1 is greater than the content of TIMx_ARR, the CC1IF bit goes high on the counter overflow (in up-counting and up/down-counting modes) or underflow (in down-counting mode). There are 3 possible options for flag setting in center-aligned mode, refer to the CMS bits in the TIMx_CR1 register for the full description. If channel CC1 is configured as input: this bit is set when counter value has been captured in TIMx_CCR1 register (an edge has been detected on IC1, as per the edge sensitivity defined with the CC1P and CC1NP bits setting, in TIMx_CCER)..
Allowed values:
0x0: B_0x0: No compare match / No input capture occurred
0x1: B_0x1: A compare match or an input capture occurred.
Bit 6: Trigger interrupt flag This flag is set by hardware on the TRG trigger event (active edge detected on TRGI input when the slave mode controller is enabled in all modes but gated mode. It is set when the counter starts or stops when gated mode is selected. It is cleared by software..
Allowed values:
0x0: B_0x0: No trigger event occurred.
0x1: B_0x1: Trigger interrupt pending.
Bit 7: Break interrupt flag This flag is set by hardware as soon as the break input goes active. It can be cleared by software if the break input is not active..
Allowed values:
0x0: B_0x0: No break event occurred.
0x1: B_0x1: An active level has been detected on the break input. An interrupt is generated if BIE=1 in the TIMx_DIER register.
Bit 8: Break 2 interrupt flag This flag is set by hardware as soon as the break 2 input goes active. It can be cleared by software if the break 2 input is not active..
Allowed values:
0x0: B_0x0: No break event occurred.
0x1: B_0x1: An active level has been detected on the break 2 input. An interrupt is generated if BIE=1 in the TIMx_DIER register.
Bit 9: Capture/Compare 1 overcapture flag This flag is set by hardware only when the corresponding channel is configured in input capture mode. It is cleared by software by writing it to '0â..
Allowed values:
0x0: B_0x0: No overcapture has been detected.
0x1: B_0x1: The counter value has been captured in TIMx_CCR1 register while CC1IF flag was already set
Bit 13: System Break interrupt flag This flag is set by hardware as soon as the system break input goes active. It can be cleared by software if the system break input is not active. This flag must be reset to re-start PWM operation..
Allowed values:
0x0: B_0x0: No break event occurred.
0x1: B_0x1: An active level has been detected on the system break input. An interrupt is generated if BIE=1 in the TIMx_DIER register.
event generation register
Offset: 0x14, reset: 0x0000, access: write-only
6/9 fields covered.
Bit 0: Update generation This bit can be set by software, it is automatically cleared by hardware..
Allowed values:
0x0: B_0x0: No action
0x1: B_0x1: Reinitialize the counter and generates an update of the registers. The prescaler internal counter is also cleared (the prescaler ratio is not affected). The counter is cleared if the center-aligned mode is selected or if DIR=0 (upcounting), else it takes the auto-reload value (TIMx_ARR) if DIR=1 (downcounting).
Bit 1: Capture/Compare 1 generation This bit is set by software in order to generate an event, it is automatically cleared by hardware. If channel CC1 is configured as output: CC1IF flag is set, Corresponding interrupt or DMA request is sent if enabled. If channel CC1 is configured as input: The current value of the counter is captured in TIMx_CCR1 register. The CC1IF flag is set, the corresponding interrupt or DMA request is sent if enabled. The CC1OF flag is set if the CC1IF flag was already high..
Allowed values:
0x0: B_0x0: No action
0x1: B_0x1: A capture/compare event is generated on channel 1:
Bit 5: Capture/Compare control update generation This bit can be set by software, it is automatically cleared by hardware Note: This bit acts only on channels having a complementary output..
Allowed values:
0x0: B_0x0: No action
0x1: B_0x1: When CCPC bit is set, it allows CCxE, CCxNE and OCxM bits to be updated.
capture/compare mode register 1 (output mode)
Offset: 0x18, reset: 0x00000000, access: read-write
4/6 fields covered.
Bits 0-1: Capture/Compare 1 Selection This bit-field defines the direction of the channel (input/output) as well as the used input. Note: CC1S bits are writable only when the channel is OFF (CC1E = '0â in TIMx_CCER)..
Allowed values:
0x0: B_0x0: CC1 channel is configured as output
0x1: B_0x1: CC1 channel is configured as input, IC1 is mapped on TI1
0x2: B_0x2: CC1 channel is configured as input, IC1 is mapped on TI2
0x3: B_0x3: CC1 channel is configured as input, IC1 is mapped on TRC. This mode is working only if an internal trigger input is selected through TS bit (TIMx_SMCR register)
Bits 2-3: Input capture 1 prescaler This bit-field defines the ratio of the prescaler acting on CC1 input (IC1). The prescaler is reset as soon as CC1E=â0â (TIMx_CCER register)..
Allowed values:
0x0: B_0x0: no prescaler, capture is done each time an edge is detected on the capture input
0x1: B_0x1: capture is done once every 2 events
0x2: B_0x2: capture is done once every 4 events
0x3: B_0x3: capture is done once every 8 events
Bits 4-7: Input capture 1 filter This bit-field defines the frequency used to sample TI1 input and the length of the digital filter applied to TI1. The digital filter is made of an event counter in which N consecutive events are needed to validate a transition on the output:.
Allowed values:
0x0: B_0x0: No filter, sampling is done at fDTS
0x1: B_0x1: fSAMPLING=fCK_INT, N=2
0x2: B_0x2: fSAMPLING=fCK_INT, N=4
0x3: B_0x3: fSAMPLING=fCK_INT, N=8
0x4: B_0x4: fSAMPLING=fDTS/2, N=6
0x5: B_0x5: fSAMPLING=fDTS/2, N=8
0x6: B_0x6: fSAMPLING=fDTS/4, N=6
0x7: B_0x7: fSAMPLING=fDTS/4, N=8
0x8: B_0x8: fSAMPLING=fDTS/8, N=6
0x9: B_0x9: fSAMPLING=fDTS/8, N=8
0xA: B_0xA: fSAMPLING=fDTS/16, N=5
0xB: B_0xB: fSAMPLING=fDTS/16, N=6
0xC: B_0xC: fSAMPLING=fDTS/16, N=8
0xD: B_0xD: fSAMPLING=fDTS/32, N=5
0xE: B_0xE: fSAMPLING=fDTS/32, N=6
0xF: B_0xF: fSAMPLING=fDTS/32, N=8
Bits 8-9: Capture/Compare 2 selection This bit-field defines the direction of the channel (input/output) as well as the used input. Note: CC2S bits are writable only when the channel is OFF (CC2E = '0â in TIMx_CCER)..
Allowed values:
0x0: B_0x0: CC2 channel is configured as output
0x1: B_0x1: CC2 channel is configured as input, IC2 is mapped on TI2
0x2: B_0x2: CC2 channel is configured as input, IC2 is mapped on TI1
0x3: B_0x3: CC2 channel is configured as input, IC2 is mapped on TRC. This mode is working only if an internal trigger input is selected through TS bit (TIMx_SMCR register)
capture/compare mode register 1 (output mode)
Offset: 0x18, reset: 0x00000000, access: read-write
7/12 fields covered.
Bits 0-1: Capture/Compare 1 selection This bit-field defines the direction of the channel (input/output) as well as the used input. Note: CC1S bits are writable only when the channel is OFF (CC1E = '0â in TIMx_CCER)..
Allowed values:
0x0: B_0x0: CC1 channel is configured as output
0x1: B_0x1: CC1 channel is configured as input, IC1 is mapped on TI1
0x2: B_0x2: CC1 channel is configured as input, IC1 is mapped on TI2
0x3: B_0x3: CC1 channel is configured as input, IC1 is mapped on TRC. This mode is working only if an internal trigger input is selected through TS bit (TIMx_SMCR register)
Bit 2: Output Compare 1 fast enable This bit decreases the latency between a trigger event and a transition on the timer output. It must be used in one-pulse mode (OPM bit set in TIMx_CR1 register), to have the output pulse starting as soon as possible after the starting trigger..
Allowed values:
0x0: B_0x0: CC1 behaves normally depending on counter and CCR1 values even when the trigger is ON. The minimum delay to activate CC1 output when an edge occurs on the trigger input is 5 clock cycles.
0x1: B_0x1: An active edge on the trigger input acts like a compare match on CC1 output. Then, OC is set to the compare level independently from the result of the comparison. Delay to sample the trigger input and to activate CC1 output is reduced to 3 clock cycles. OCFE acts only if the channel is configured in PWM1 or PWM2 mode.
Bit 3: Output Compare 1 preload enable Note: These bits can not be modified as long as LOCK level 3 has been programmed (LOCK bits in TIMx_BDTR register) and CC1S=â00â (the channel is configured in output). The PWM mode can be used without validating the preload register only in one pulse mode (OPM bit set in TIMx_CR1 register). Else the behavior is not guaranteed..
Allowed values:
0x0: B_0x0: Preload register on TIMx_CCR1 disabled. TIMx_CCR1 can be written at anytime, the new value is taken in account immediately.
0x1: B_0x1: Preload register on TIMx_CCR1 enabled. Read/Write operations access the preload register. TIMx_CCR1 preload value is loaded in the active register at each update event.
Bits 4-6: Output Compare 1 mode These bits define the behavior of the output reference signal OC1REF from which OC1 and OC1N are derived. OC1REF is active high whereas OC1 and OC1N active level depends on CC1P and CC1NP bits. Note: These bits can not be modified as long as LOCK level 3 has been programmed (LOCK bits in TIMx_BDTR register) and CC1S=â00â (the channel is configured in output). Note: In PWM mode, the OCREF level changes only when the result of the comparison changes or when the output compare mode switches from âfrozenâ mode to âPWMâ mode. Note: On channels having a complementary output, this bit field is preloaded. If the CCPC bit is set in the TIMx_CR2 register then the OC1M active bits take the new value from the preloaded bits only when a COM event is generated. Note: The OC1M[3] bit is not contiguous, located in bit 16..
Bits 8-9: Capture/Compare 2 selection This bit-field defines the direction of the channel (input/output) as well as the used input. Note: CC2S bits are writable only when the channel is OFF (CC2E = '0â in TIMx_CCER)..
Allowed values:
0x0: B_0x0: CC2 channel is configured as output
0x1: B_0x1: CC2 channel is configured as input, IC2 is mapped on TI2
0x2: B_0x2: CC2 channel is configured as input, IC2 is mapped on TI1
0x3: B_0x3: CC2 channel is configured as input, IC2 is mapped on TRC. This mode is working only if an internal trigger input is selected through the TS bit (TIMx_SMCR register)
Bits 12-14: Output Compare 2 mode Refer to OC1M[3:0] description..
Allowed values:
0: Frozen: The comparison between the output compare register TIMx_CCRy and the counter TIMx_CNT has no effect on the outputs / OpmMode1: Retriggerable OPM mode 1 - In up-counting mode, the channel is active until a trigger event is detected (on TRGI signal). In down-counting mode, the channel is inactive
1: ActiveOnMatch: Set channel to active level on match. OCyREF signal is forced high when the counter matches the capture/compare register / OpmMode2: Inversely to OpmMode1
2: InactiveOnMatch: Set channel to inactive level on match. OCyREF signal is forced low when the counter matches the capture/compare register / Reserved
3: Toggle: OCyREF toggles when TIMx_CNT=TIMx_CCRy / Reserved
4: ForceInactive: OCyREF is forced low / CombinedPwmMode1: OCyREF has the same behavior as in PWM mode 1. OCyREFC is the logical OR between OC1REF and OC2REF
5: ForceActive: OCyREF is forced high / CombinedPwmMode2: OCyREF has the same behavior as in PWM mode 2. OCyREFC is the logical AND between OC1REF and OC2REF
6: PwmMode1: In upcounting, channel is active as long as TIMx_CNT
7: PwmMode2: Inversely to PwmMode1 / AsymmetricPwmMode2: Inversely to AsymmetricPwmMode1
Bit 16: Output Compare 1 mode These bits define the behavior of the output reference signal OC1REF from which OC1 and OC1N are derived. OC1REF is active high whereas OC1 and OC1N active level depends on CC1P and CC1NP bits. Note: These bits can not be modified as long as LOCK level 3 has been programmed (LOCK bits in TIMx_BDTR register) and CC1S=â00â (the channel is configured in output). Note: In PWM mode, the OCREF level changes only when the result of the comparison changes or when the output compare mode switches from âfrozenâ mode to âPWMâ mode. Note: On channels having a complementary output, this bit field is preloaded. If the CCPC bit is set in the TIMx_CR2 register then the OC1M active bits take the new value from the preloaded bits only when a COM event is generated. Note: The OC1M[3] bit is not contiguous, located in bit 16..
capture/compare mode register 2 (output mode)
Offset: 0x1C, reset: 0x00000000, access: read-write
2/6 fields covered.
Bits 0-1: Capture/compare 3 selection This bit-field defines the direction of the channel (input/output) as well as the used input. Note: CC3S bits are writable only when the channel is OFF (CC3E = '0â in TIMx_CCER)..
Allowed values:
0x0: B_0x0: CC3 channel is configured as output
0x1: B_0x1: CC3 channel is configured as input, IC3 is mapped on TI3
0x2: B_0x2: CC3 channel is configured as input, IC3 is mapped on TI4
0x3: B_0x3: CC3 channel is configured as input, IC3 is mapped on TRC. This mode is working only if an internal trigger input is selected through TS bit (TIMx_SMCR register)
Bits 8-9: Capture/Compare 4 selection This bit-field defines the direction of the channel (input/output) as well as the used input. Note: CC4S bits are writable only when the channel is OFF (CC4E = '0â in TIMx_CCER)..
Allowed values:
0x0: B_0x0: CC4 channel is configured as output
0x1: B_0x1: CC4 channel is configured as input, IC4 is mapped on TI4
0x2: B_0x2: CC4 channel is configured as input, IC4 is mapped on TI3
0x3: B_0x3: CC4 channel is configured as input, IC4 is mapped on TRC. This mode is working only if an internal trigger input is selected through TS bit (TIMx_SMCR register)
capture/compare mode register 2 (output mode)
Offset: 0x1C, reset: 0x00000000, access: read-write
6/12 fields covered.
Bits 0-1: Capture/Compare 3 selection This bit-field defines the direction of the channel (input/output) as well as the used input. Note: CC3S bits are writable only when the channel is OFF (CC3E = '0â in TIMx_CCER)..
Allowed values:
0x0: B_0x0: CC3 channel is configured as output
0x1: B_0x1: CC3 channel is configured as input, IC3 is mapped on TI3
0x2: B_0x2: CC3 channel is configured as input, IC3 is mapped on TI4
0x3: B_0x3: CC3 channel is configured as input, IC3 is mapped on TRC. This mode is working only if an internal trigger input is selected through TS bit (TIMx_SMCR register)
Bits 4-6: Output compare 3 mode Refer to OC1M[3:0] description..
Allowed values:
0: Frozen: The comparison between the output compare register TIMx_CCRy and the counter TIMx_CNT has no effect on the outputs / OpmMode1: Retriggerable OPM mode 1 - In up-counting mode, the channel is active until a trigger event is detected (on TRGI signal). In down-counting mode, the channel is inactive
1: ActiveOnMatch: Set channel to active level on match. OCyREF signal is forced high when the counter matches the capture/compare register / OpmMode2: Inversely to OpmMode1
2: InactiveOnMatch: Set channel to inactive level on match. OCyREF signal is forced low when the counter matches the capture/compare register / Reserved
3: Toggle: OCyREF toggles when TIMx_CNT=TIMx_CCRy / Reserved
4: ForceInactive: OCyREF is forced low / CombinedPwmMode1: OCyREF has the same behavior as in PWM mode 1. OCyREFC is the logical OR between OC1REF and OC2REF
5: ForceActive: OCyREF is forced high / CombinedPwmMode2: OCyREF has the same behavior as in PWM mode 2. OCyREFC is the logical AND between OC1REF and OC2REF
6: PwmMode1: In upcounting, channel is active as long as TIMx_CNT
7: PwmMode2: Inversely to PwmMode1 / AsymmetricPwmMode2: Inversely to AsymmetricPwmMode1
Bits 8-9: Capture/Compare 4 selection This bit-field defines the direction of the channel (input/output) as well as the used input. Note: CC4S bits are writable only when the channel is OFF (CC4E = '0â in TIMx_CCER)..
Allowed values:
0x0: B_0x0: CC4 channel is configured as output
0x1: B_0x1: CC4 channel is configured as input, IC4 is mapped on TI4
0x2: B_0x2: CC4 channel is configured as input, IC4 is mapped on TI3
0x3: B_0x3: CC4 channel is configured as input, IC4 is mapped on TRC. This mode is working only if an internal trigger input is selected through TS bit (TIMx_SMCR register)
Bits 12-14: Output compare 4 mode Refer to OC3M[3:0] description..
Allowed values:
0: Frozen: The comparison between the output compare register TIMx_CCRy and the counter TIMx_CNT has no effect on the outputs / OpmMode1: Retriggerable OPM mode 1 - In up-counting mode, the channel is active until a trigger event is detected (on TRGI signal). In down-counting mode, the channel is inactive
1: ActiveOnMatch: Set channel to active level on match. OCyREF signal is forced high when the counter matches the capture/compare register / OpmMode2: Inversely to OpmMode1
2: InactiveOnMatch: Set channel to inactive level on match. OCyREF signal is forced low when the counter matches the capture/compare register / Reserved
3: Toggle: OCyREF toggles when TIMx_CNT=TIMx_CCRy / Reserved
4: ForceInactive: OCyREF is forced low / CombinedPwmMode1: OCyREF has the same behavior as in PWM mode 1. OCyREFC is the logical OR between OC1REF and OC2REF
5: ForceActive: OCyREF is forced high / CombinedPwmMode2: OCyREF has the same behavior as in PWM mode 2. OCyREFC is the logical AND between OC1REF and OC2REF
6: PwmMode1: In upcounting, channel is active as long as TIMx_CNT
7: PwmMode2: Inversely to PwmMode1 / AsymmetricPwmMode2: Inversely to AsymmetricPwmMode1
capture/compare enable register
Offset: 0x20, reset: 0x0000, access: read-write
4/19 fields covered.
Bit 0: Capture/Compare 1 output enable When CC1 channel is configured as output, the OC1 level depends on MOE, OSSI, OSSR, OIS1, OIS1N and CC1NE bits, regardless of the CC1E bits state. Refer to for details. Note: On channels having a complementary output, this bit is preloaded. If the CCPC bit is set in the TIMx_CR2 register then the CC1E active bit takes the new value from the preloaded bit only when a Commutation event is generated..
Allowed values:
0x0: B_0x0: Capture mode disabled / OC1 is not active (see below)
0x1: B_0x1: Capture mode enabled / OC1 signal is output on the corresponding output pin
Bit 1: Capture/Compare 1 output polarity When CC1 channel is configured as input, both CC1NP/CC1P bits select the active polarity of TI1FP1 and TI2FP1 for trigger or capture operations. CC1NP=0, CC1P=0: non-inverted/rising edge. The circuit is sensitive to TIxFP1 rising edge (capture or trigger operations in reset, external clock or trigger mode), TIxFP1 is not inverted (trigger operation in gated mode or encoder mode). CC1NP=0, CC1P=1: inverted/falling edge. The circuit is sensitive to TIxFP1 falling edge (capture or trigger operations in reset, external clock or trigger mode), TIxFP1 is inverted (trigger operation in gated mode or encoder mode). CC1NP=1, CC1P=1: non-inverted/both edges/ The circuit is sensitive to both TIxFP1 rising and falling edges (capture or trigger operations in reset, external clock or trigger mode), TIxFP1is not inverted (trigger operation in gated mode). This configuration must not be used in encoder mode. CC1NP=1, CC1P=0: The configuration is reserved, it must not be used. Note: This bit is not writable as soon as LOCK level 2 or 3 has been programmed (LOCK bits in TIMx_BDTR register). On channels having a complementary output, this bit is preloaded. If the CCPC bit is set in the TIMx_CR2 register then the CC1P active bit takes the new value from the preloaded bit only when a Commutation event is generated..
Allowed values:
0x0: B_0x0: OC1 active high (output mode) / Edge sensitivity selection (input mode, see below)
0x1: B_0x1: OC1 active low (output mode) / Edge sensitivity selection (input mode, see below)
Bit 2: Capture/Compare 1 complementary output enable On channels having a complementary output, this bit is preloaded. If the CCPC bit is set in the TIMx_CR2 register then the CC1NE active bit takes the new value from the preloaded bit only when a Commutation event is generated..
Allowed values:
0x0: B_0x0: Off - OC1N is not active. OC1N level is then function of MOE, OSSI, OSSR, OIS1, OIS1N and CC1E bits.
0x1: B_0x1: On - OC1N signal is output on the corresponding output pin depending on MOE, OSSI, OSSR, OIS1, OIS1N and CC1E bits.
Bit 3: Capture/Compare 1 complementary output polarity CC1 channel configured as output: CC1 channel configured as input: This bit is used in conjunction with CC1P to define the polarity of TI1FP1 and TI2FP1. Refer to CC1P description. Note: This bit is not writable as soon as LOCK level 2 or 3 has been programmed (LOCK bits in TIMx_BDTR register) and CC1S=â00â (channel configured as output). On channels having a complementary output, this bit is preloaded. If the CCPC bit is set in the TIMx_CR2 register then the CC1NP active bit takes the new value from the preloaded bit only when a Commutation event is generated..
Allowed values:
0x0: B_0x0: OC1N active high.
0x1: B_0x1: OC1N active low.
counter
Offset: 0x24, reset: 0x00000000, access: Unspecified
1/2 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
UIFCPY
r |
|||||||||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
CNT
rw |
|||||||||||||||
prescaler
Offset: 0x28, reset: 0x0000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
PSC
rw |
|||||||||||||||
Bits 0-15: Prescaler value The counter clock frequency (CK_CNT) is equal to fCK_PSC / (PSC[15:0] + 1). PSC contains the value to be loaded in the active prescaler register at each update event (including when the counter is cleared through UG bit of TIMx_EGR register or through trigger controller when configured in âreset modeâ)..
auto-reload register
Offset: 0x2C, reset: 0x0000FFFF, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
ARR
rw |
|||||||||||||||
repetition counter register
Offset: 0x30, reset: 0x0000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
REP
rw |
|||||||||||||||
capture/compare register 1
Offset: 0x34, reset: 0x00000000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
CCR1
rw |
|||||||||||||||
capture/compare register 2
Offset: 0x38, reset: 0x00000000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
CCR2
rw |
|||||||||||||||
capture/compare register 3
Offset: 0x3C, reset: 0x00000000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
CCR3
rw |
|||||||||||||||
capture/compare register 4
Offset: 0x40, reset: 0x00000000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
CCR4
rw |
|||||||||||||||
break and dead-time register
Offset: 0x44, reset: 0x0000, access: read-write
13/16 fields covered.
Bits 0-7: Dead-time generator setup This bit-field defines the duration of the dead-time inserted between the complementary outputs. DT correspond to this duration. DTG[7:5]=0xx => DT=DTG[7:0]x tDTG with tDTG=tDTS. DTG[7:5]=10x => DT=(64+DTG[5:0])xtDTG with tDTG=2xtDTS. DTG[7:5]=110 => DT=(32+DTG[4:0])xtDTG with tDTG=8xtDTS. DTG[7:5]=111 => DT=(32+DTG[4:0])xtDTG with tDTG=16xtDTS. Example if tDTS=125 ns (8 MHz), dead-time possible values are: 0 to 15875 ns by 125 ns steps, 16 μs to 31750 ns by 250 ns steps, 32 μs to 63 μs by 1 μs steps, 64 μs to 126 μs by 2 μs steps Note: This bit-field can not be modified as long as LOCK level 1, 2 or 3 has been programmed (LOCK bits in TIMx_BDTR register)..
Bits 8-9: Lock configuration These bits offer a write protection against software errors. Note: The LOCK bits can be written only once after the reset. Once the TIMx_BDTR register has been written, their content is frozen until the next reset..
Allowed values:
0x0: B_0x0: LOCK OFF - No bit is write protected.
0x1: B_0x1: LOCK Level 1 = DTG bits in TIMx_BDTR register, OISx and OISxN bits in TIMx_CR2 register and BK2BID, BKBID, BK2DSRM, BKDSRM, BK2P, BK2E, BK2F[3:0], BKF[3:0], AOE, BKP, BKE, OSSI, OSSR and DTG[7:0] bits in TIMx_BDTR register can no longer be written.
0x2: B_0x2: LOCK Level 2 = LOCK Level 1 + CC Polarity bits (CCxP/CCxNP bits in TIMx_CCER register, as long as the related channel is configured in output through the CCxS bits) as well as OSSR and OSSI bits can no longer be written.
0x3: B_0x3: LOCK Level 3 = LOCK Level 2 + CC Control bits (OCxM and OCxPE bits in TIMx_CCMRx registers, as long as the related channel is configured in output through the CCxS bits) can no longer be written.
Bit 10: Off-state selection for Idle mode This bit is used when MOE=0 due to a break event or by a software write, on channels configured as outputs. See OC/OCN enable description for more details (enable register (TIM1_CCERTIMx_CCER)N/A). Note: This bit can not be modified as soon as the LOCK level 2 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: When inactive, OC/OCN outputs are disabled (the timer releases the output control which is taken over by the GPIO logic and which imposes a Hi-Z state).
0x1: B_0x1: When inactive, OC/OCN outputs are first forced with their inactive level then forced to their idle level after the deadtime. The timer maintains its control over the output.
Bit 11: Off-state selection for Run mode This bit is used when MOE=1 on channels having a complementary output which are configured as outputs. OSSR is not implemented if no complementary output is implemented in the timer. See OC/OCN enable description for more details (enable register (TIM1_CCERTIMx_CCER)N/A). Note: This bit can not be modified as soon as the LOCK level 2 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: When inactive, OC/OCN outputs are disabled (the timer releases the output control which is taken over by the GPIO logic, which forces a Hi-Z state).
0x1: B_0x1: When inactive, OC/OCN outputs are enabled with their inactive level as soon as CCxE=1 or CCxNE=1 (the output is still controlled by the timer).
Bit 12: Break enable This bit enables the complete break protection (including all sources connected to bk_acth and BKIN sources, as per ). Note: This bit cannot be modified when LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register). Note: Any write operation to this bit takes a delay of 1 APB clock cycle to become effective..
Allowed values:
0x0: B_0x0: Break function disabled
0x1: B_0x1: Break function enabled
Bit 13: Break polarity Note: This bit can not be modified as long as LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register). Note: Any write operation to this bit takes a delay of 1 APB clock cycle to become effective..
Allowed values:
0x0: B_0x0: Break input BRK is active low
0x1: B_0x1: Break input BRK is active high
Bit 14: Automatic output enable Note: This bit can not be modified as long as LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: MOE can be set only by software
0x1: B_0x1: MOE can be set by software or automatically at the next update event (if none of the break inputs BRK and BRK2 is active)
Bit 15: Main output enable This bit is cleared asynchronously by hardware as soon as one of the break inputs is active (BRK or BRK2). It is set by software or automatically depending on the AOE bit. It is acting only on the channels which are configured in output. In response to a break event or if MOE is written to 0: OC and OCN outputs are disabled or forced to idle state depending on the OSSI bit. See OC/OCN enable description for more details (enable register (TIM1_CCERTIMx_CCER)N/A)..
Allowed values:
0x0: B_0x0: In response to a break 2 event. OC and OCN outputs are disabled
0x1: B_0x1: OC and OCN outputs are enabled if their respective enable bits are set (CCxE, CCxNE in TIMx_CCER register).
Bits 16-19: Break filter This bit-field defines the frequency used to sample BRK input and the length of the digital filter applied to BRK. The digital filter is made of an event counter in which N consecutive events are needed to validate a transition on the output: Note: This bit cannot be modified when LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: No filter, BRK acts asynchronously
0x1: B_0x1: fSAMPLING=fCK_INT, N=2
0x2: B_0x2: fSAMPLING=fCK_INT, N=4
0x3: B_0x3: fSAMPLING=fCK_INT, N=8
0x4: B_0x4: fSAMPLING=fDTS/2, N=6
0x5: B_0x5: fSAMPLING=fDTS/2, N=8
0x6: B_0x6: fSAMPLING=fDTS/4, N=6
0x7: B_0x7: fSAMPLING=fDTS/4, N=8
0x8: B_0x8: fSAMPLING=fDTS/8, N=6
0x9: B_0x9: fSAMPLING=fDTS/8, N=8
0xA: B_0xA: fSAMPLING=fDTS/16, N=5
0xB: B_0xB: fSAMPLING=fDTS/16, N=6
0xC: B_0xC: fSAMPLING=fDTS/16, N=8
0xD: B_0xD: fSAMPLING=fDTS/32, N=5
0xE: B_0xE: fSAMPLING=fDTS/32, N=6
0xF: B_0xF: fSAMPLING=fDTS/32, N=8
Bits 20-23: Break 2 filter This bit-field defines the frequency used to sample BRK2 input and the length of the digital filter applied to BRK2. The digital filter is made of an event counter in which N consecutive events are needed to validate a transition on the output: Note: This bit cannot be modified when LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: No filter, BRK2 acts asynchronously
0x1: B_0x1: fSAMPLING=fCK_INT, N=2
0x2: B_0x2: fSAMPLING=fCK_INT, N=4
0x3: B_0x3: fSAMPLING=fCK_INT, N=8
0x4: B_0x4: fSAMPLING=fDTS/2, N=6
0x5: B_0x5: fSAMPLING=fDTS/2, N=8
0x6: B_0x6: fSAMPLING=fDTS/4, N=6
0x7: B_0x7: fSAMPLING=fDTS/4, N=8
0x8: B_0x8: fSAMPLING=fDTS/8, N=6
0x9: B_0x9: fSAMPLING=fDTS/8, N=8
0xA: B_0xA: fSAMPLING=fDTS/16, N=5
0xB: B_0xB: fSAMPLING=fDTS/16, N=6
0xC: B_0xC: fSAMPLING=fDTS/16, N=8
0xD: B_0xD: fSAMPLING=fDTS/32, N=5
0xE: B_0xE: fSAMPLING=fDTS/32, N=6
0xF: B_0xF: fSAMPLING=fDTS/32, N=8
Bit 24: Break 2 enable Note: The BRK2 must only be used with OSSR = OSSI = 1. Note: This bit cannot be modified when LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register). Note: Any write operation to this bit takes a delay of 1 APB clock cycle to become effective..
Allowed values:
0x0: B_0x0: Break input BRK2 disabled
0x1: B_0x1: Break input BRK2 enabled
Bit 25: Break 2 polarity Note: This bit cannot be modified as long as LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register). Note: Any write operation to this bit takes a delay of 1 APB clock cycle to become effective..
Allowed values:
0x0: B_0x0: Break input BRK2 is active low
0x1: B_0x1: Break input BRK2 is active high
Bit 26: Break Disarm This bit is cleared by hardware when no break source is active. The BKDSRM bit must be set by software to release the bidirectional output control (open-drain output in Hi-Z state) and then be polled it until it is reset by hardware, indicating that the fault condition has disappeared. Note: Any write operation to this bit takes a delay of 1 APB clock cycle to become effective..
Allowed values:
0x0: B_0x0: Break input BRK is armed
0x1: B_0x1: Break input BRK is disarmed
Bit 28: Break Bidirectional In the bidirectional mode (BKBID bit set to 1), the break input is configured both in input mode and in open drain output mode. Any active break event asserts a low logic level on the Break input to indicate an internal break event to external devices. Note: This bit cannot be modified as long as LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register). Note: Any write operation to this bit takes a delay of 1 APB clock cycle to become effective..
Allowed values:
0x0: B_0x0: Break input BRK in input mode
0x1: B_0x1: Break input BRK in bidirectional mode
DMA control register
Offset: 0x48, reset: 0x0000, access: read-write
2/2 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
DBL
rw |
DBA
rw |
||||||||||||||
Bits 0-4: DMA base address This 5-bits vector defines the base-address for DMA transfers (when read/write access are done through the TIMx_DMAR address). DBA is defined as an offset starting from the address of the TIMx_CR1 register. Example: ....
Allowed values:
0x0: B_0x0: TIMx_CR1,
0x1: B_0x1: TIMx_CR2,
0x2: B_0x2: TIMx_SMCR,
Bits 8-12: DMA burst length This 5-bit vector defines the length of DMA transfers (the timer recognizes a burst transfer when a read or a write access is done to the TIMx_DMAR address), i.e. the number of transfers. Transfers can be in half-words or in bytes (see example below). ... Example: Let us consider the following transfer: DBL = 7 bytes & DBA = TIMx_CR1. If DBL = 7 bytes and DBA = TIMx_CR1 represents the address of the byte to be transferred, the address of the transfer should be given by the following equation: (TIMx_CR1 address) + DBA + (DMA index), where DMA index = DBL In this example, 7 bytes are added to (TIMx_CR1 address) + DBA, which gives us the address from/to which the data is copied. In this case, the transfer is done to 7 registers starting from the following address: (TIMx_CR1 address) + DBA According to the configuration of the DMA Data Size, several cases may occur: If the DMA Data Size is configured in half-words, 16-bit data is transferred to each of the 7 registers. If the DMA Data Size is configured in bytes, the data is also transferred to 7 registers: the first register contains the first MSB byte, the second register, the first LSB byte and so on. So with the transfer Timer, one also has to specify the size of data transferred by DMA..
Allowed values:
0x0: B_0x0: 1 transfer
0x1: B_0x1: 2 transfers
0x2: B_0x2: 3 transfers
0x11: B_0x11: 18 transfers
DMA address for full transfer
Offset: 0x4C, reset: 0x0000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
DMAB
rw |
|||||||||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
DMAB
rw |
|||||||||||||||
Bits 0-31: DMA register for burst accesses A read or write operation to the DMAR register accesses the register located at the address (TIMx_CR1 address) + (DBA + DMA index) x 4 where TIMx_CR1 address is the address of the control register 1, DBA is the DMA base address configured in TIMx_DCR register, DMA index is automatically controlled by the DMA transfer, and ranges from 0 to DBL (DBL configured in TIMx_DCR)..
option register 1
Offset: 0x50, reset: 0x0000, access: read-write
1/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
OCREF_CLR
rw |
|||||||||||||||
capture/compare mode register 2 (output mode)
Offset: 0x54, reset: 0x00000000, access: read-write
4/10 fields covered.
Bits 4-6: Output compare 5 mode.
Allowed values:
0: Frozen: The comparison between the output compare register TIMx_CCRy and the counter TIMx_CNT has no effect on the outputs / OpmMode1: Retriggerable OPM mode 1 - In up-counting mode, the channel is active until a trigger event is detected (on TRGI signal). In down-counting mode, the channel is inactive
1: ActiveOnMatch: Set channel to active level on match. OCyREF signal is forced high when the counter matches the capture/compare register / OpmMode2: Inversely to OpmMode1
2: InactiveOnMatch: Set channel to inactive level on match. OCyREF signal is forced low when the counter matches the capture/compare register / Reserved
3: Toggle: OCyREF toggles when TIMx_CNT=TIMx_CCRy / Reserved
4: ForceInactive: OCyREF is forced low / CombinedPwmMode1: OCyREF has the same behavior as in PWM mode 1. OCyREFC is the logical OR between OC1REF and OC2REF
5: ForceActive: OCyREF is forced high / CombinedPwmMode2: OCyREF has the same behavior as in PWM mode 2. OCyREFC is the logical AND between OC1REF and OC2REF
6: PwmMode1: In upcounting, channel is active as long as TIMx_CNT
7: PwmMode2: Inversely to PwmMode1 / AsymmetricPwmMode2: Inversely to AsymmetricPwmMode1
Bits 12-14: Output compare 6 mode.
Allowed values:
0: Frozen: The comparison between the output compare register TIMx_CCRy and the counter TIMx_CNT has no effect on the outputs / OpmMode1: Retriggerable OPM mode 1 - In up-counting mode, the channel is active until a trigger event is detected (on TRGI signal). In down-counting mode, the channel is inactive
1: ActiveOnMatch: Set channel to active level on match. OCyREF signal is forced high when the counter matches the capture/compare register / OpmMode2: Inversely to OpmMode1
2: InactiveOnMatch: Set channel to inactive level on match. OCyREF signal is forced low when the counter matches the capture/compare register / Reserved
3: Toggle: OCyREF toggles when TIMx_CNT=TIMx_CCRy / Reserved
4: ForceInactive: OCyREF is forced low / CombinedPwmMode1: OCyREF has the same behavior as in PWM mode 1. OCyREFC is the logical OR between OC1REF and OC2REF
5: ForceActive: OCyREF is forced high / CombinedPwmMode2: OCyREF has the same behavior as in PWM mode 2. OCyREFC is the logical AND between OC1REF and OC2REF
6: PwmMode1: In upcounting, channel is active as long as TIMx_CNT
7: PwmMode2: Inversely to PwmMode1 / AsymmetricPwmMode2: Inversely to AsymmetricPwmMode1
capture/compare register 4
Offset: 0x58, reset: 0x00000000, access: read-write
3/4 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
GC5C3
rw |
GC5C2
rw |
GC5C1
rw |
|||||||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
CCR5
rw |
|||||||||||||||
Bits 0-15: Capture/Compare 5 value CCR5 is the value to be loaded in the actual capture/compare 5 register (preload value). It is loaded permanently if the preload feature is not selected in the TIMx_CCMR3 register (bit OC5PE). Else the preload value is copied in the active capture/compare 5 register when an update event occurs. The active capture/compare register contains the value to be compared to the counter TIMx_CNT and signaled on OC5 output..
Bit 29: Group Channel 5 and Channel 1 Distortion on Channel 1 output: This bit can either have immediate effect or be preloaded and taken into account after an update event (if preload feature is selected in TIMxCCMR1). Note: it is also possible to apply this distortion on combined PWM signals..
Allowed values:
0x0: B_0x0: No effect of OC5REF on OC1REFC5
0x1: B_0x1: OC1REFC is the logical AND of OC1REFC and OC5REF
Bit 30: Group Channel 5 and Channel 2 Distortion on Channel 2 output: This bit can either have immediate effect or be preloaded and taken into account after an update event (if preload feature is selected in TIMxCCMR1). Note: it is also possible to apply this distortion on combined PWM signals..
Allowed values:
0x0: B_0x0: No effect of OC5REF on OC2REFC
0x1: B_0x1: OC2REFC is the logical AND of OC2REFC and OC5REF
Bit 31: Group Channel 5 and Channel 3 Distortion on Channel 3 output: This bit can either have immediate effect or be preloaded and taken into account after an update event (if preload feature is selected in TIMxCCMR2). Note: it is also possible to apply this distortion on combined PWM signals..
Allowed values:
0x0: B_0x0: No effect of OC5REF on OC3REFC
0x1: B_0x1: OC3REFC is the logical AND of OC3REFC and OC5REF
capture/compare register 4
Offset: 0x5C, reset: 0x00000000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
CCR6
rw |
|||||||||||||||
DMA address for full transfer
Offset: 0x60, reset: 0x00000001, access: read-write
7/7 fields covered.
Bit 0: BRK BKIN input enable This bit enables the BKIN alternate function input for the timerâs BRK input. BKIN input is 'ORedâ with the other BRK sources. Note: This bit can not be modified as long as LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: BKIN input disabled
0x1: B_0x1: BKIN input enabled
Bit 1: BRK COMP1 enable This bit enables the COMP1 for the timerâs BRK input. COMP1 output is 'ORedâ with the other BRK sources. Note: This bit can not be modified as long as LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: COMP1 input disabled
0x1: B_0x1: COMP1 input enabled
Bit 2: BRK COMP2 enable This bit enables the COMP2 for the timerâs BRK input. COMP2 output is 'ORedâ with the other BRK sources. Note: This bit can not be modified as long as LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: COMP2 input disabled
0x1: B_0x1: COMP2 input enabled
Bit 9: BRK BKIN input polarity This bit selects the BKIN alternate function input sensitivity. It must be programmed together with the BKP polarity bit. Note: This bit can not be modified as long as LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: BKIN input polarity is not inverted (active low if BKP=0, active high if BKP=1)
0x1: B_0x1: BKIN input polarity is inverted (active high if BKP=0, active low if BKP=1)
Bit 10: BRK COMP1 input polarity This bit selects the COMP1 input sensitivity. It must be programmed together with the BKP polarity bit. Note: This bit can not be modified as long as LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: COMP1 input polarity is not inverted (active low if BKP=0, active high if BKP=1)
0x1: B_0x1: COMP1 input polarity is inverted (active high if BKP=0, active low if BKP=1)
Bit 11: BRK COMP2 input polarity This bit selects the COMP2 input sensitivity. It must be programmed together with the BKP polarity bit. Note: This bit can not be modified as long as LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: COMP2 input polarity is not inverted (active low if BKP=0, active high if BKP=1)
0x1: B_0x1: COMP2 input polarity is inverted (active high if BKP=0, active low if BKP=1)
Bits 14-17: ETR source selection These bits select the ETR input source. Others: Reserved Note: These bits can not be modified as long as LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: ETR legacy mode
0x1: B_0x1: COMP1 output
0x2: B_0x2: COMP2 output
0x3: B_0x3: ADC1 AWD1
0x4: B_0x4: ADC1 AWD2
0x5: B_0x5: ADC1 AWD3
DMA address for full transfer
Offset: 0x64, reset: 0x00000001, access: read-write
6/6 fields covered.
Bit 0: BRK2 BKIN input enable This bit enables the BKIN2 alternate function input for the timerâs BRK2 input. BKIN2 input is 'ORedâ with the other BRK2 sources. Note: This bit can not be modified as long as LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: BKIN2 input disabled
0x1: B_0x1: BKIN2 input enabled
Bit 1: BRK2 COMP1 enable This bit enables the COMP1 for the timerâs BRK2 input. COMP1 output is 'ORedâ with the other BRK2 sources. Note: This bit can not be modified as long as LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: COMP1 input disabled
0x1: B_0x1: COMP1 input enabled
Bit 2: BRK2 COMP2 enable This bit enables the COMP2 for the timerâs BRK2 input. COMP2 output is 'ORedâ with the other BRK2 sources. Note: This bit can not be modified as long as LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: COMP2 input disabled
0x1: B_0x1: COMP2 input enabled
Bit 9: BRK2 BKIN2 input polarity This bit selects the BKIN2 alternate function input sensitivity. It must be programmed together with the BK2P polarity bit. Note: This bit can not be modified as long as LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: BKIN2 input polarity is not inverted (active low if BK2P=0, active high if BK2P=1)
0x1: B_0x1: BKIN2 input polarity is inverted (active high if BK2P=0, active low if BK2P=1)
Bit 10: BRK2 COMP1 input polarity This bit selects the COMP1 input sensitivity. It must be programmed together with the BK2P polarity bit. Note: This bit can not be modified as long as LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: COMP1 input polarity is not inverted (active low if BK2P=0, active high if BK2P=1)
0x1: B_0x1: COMP1 input polarity is inverted (active high if BK2P=0, active low if BK2P=1)
Bit 11: BRK2 COMP2 input polarity This bit selects the COMP2 input sensitivity. It must be programmed together with the BK2P polarity bit. Note: This bit can not be modified as long as LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: COMP2 input polarity is not inverted (active low if BK2P=0, active high if BK2P=1)
0x1: B_0x1: COMP2 input polarity is inverted (active high if BK2P=0, active low if BK2P=1)
TIM1 timer input selection register
Offset: 0x68, reset: 0x00000000, access: read-write
4/4 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
TI4SEL
rw |
TI3SEL
rw |
||||||||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
TI2SEL
rw |
TI1SEL
rw |
||||||||||||||
0x40002000: General purpose timers
24/31 fields covered. Toggle Registers
| Offset | Name | 31 |
30 |
29 |
28 |
27 |
26 |
25 |
24 |
23 |
22 |
21 |
20 |
19 |
18 |
17 |
16 |
15 |
14 |
13 |
12 |
11 |
10 |
9 |
8 |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x0 | CR1 | ||||||||||||||||||||||||||||||||
| 0xC | DIER | ||||||||||||||||||||||||||||||||
| 0x10 | SR | ||||||||||||||||||||||||||||||||
| 0x14 | EGR | ||||||||||||||||||||||||||||||||
| 0x18 | CCMR1_Input | ||||||||||||||||||||||||||||||||
| 0x18 | CCMR1_Output | ||||||||||||||||||||||||||||||||
| 0x20 | CCER | ||||||||||||||||||||||||||||||||
| 0x24 | CNT | ||||||||||||||||||||||||||||||||
| 0x28 | PSC | ||||||||||||||||||||||||||||||||
| 0x2C | ARR | ||||||||||||||||||||||||||||||||
| 0x34 | CCR1 | ||||||||||||||||||||||||||||||||
| 0x68 | TISEL | ||||||||||||||||||||||||||||||||
control register 1
Offset: 0x0, reset: 0x0000, access: read-write
7/7 fields covered.
Bit 1: Update disable This bit is set and cleared by software to enable/disable update interrupt (UEV) event generation. Counter overflow Setting the UG bit. Buffered registers are then loaded with their preload values..
Allowed values:
0x0: B_0x0: UEV enabled. An UEV is generated by one of the following events:
0x1: B_0x1: UEV disabled. No UEV is generated, shadow registers keep their value (ARR, PSC, CCRx). The counter and the prescaler are reinitialized if the UG bit is set.
Bit 2: Update request source This bit is set and cleared by software to select the update interrupt (UEV) sources. Counter overflow Setting the UG bit.
Allowed values:
0x0: B_0x0: Any of the following events generate an UEV if enabled:
0x1: B_0x1: Only counter overflow generates an UEV if enabled.
DMA/Interrupt enable register
Offset: 0xC, reset: 0x0000, access: read-write
2/2 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
CC1IE
rw |
UIE
rw |
||||||||||||||
status register
Offset: 0x10, reset: 0x0000, access: read-write
3/3 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
CC1OF
rw |
CC1IF
rw |
UIF
rw |
|||||||||||||
Bit 0: Update interrupt flag This bit is set by hardware on an update event. It is cleared by software. At overflow and if UDIS=â0â in the TIMx_CR1 register. When CNT is reinitialized by software using the UG bit in TIMx_EGR register, if URS=â0â and UDIS=â0â in the TIMx_CR1 register..
Allowed values:
0x0: B_0x0: No update occurred.
0x1: B_0x1: Update interrupt pending. This bit is set by hardware when the registers are updated:
Bit 1: Capture/compare 1 interrupt flag This flag is set by hardware. It is cleared by software (input capture or output compare mode) or by reading the TIMx_CCR1 register (input capture mode only). If channel CC1 is configured as output: this flag is set when he content of the counter TIMx_CNT matches the content of the TIMx_CCR1 register. When the content of TIMx_CCR1 is greater than the content of TIMx_ARR, the CC1IF bit goes high on the counter overflow (in up-counting and up/down-counting modes) or underflow (in down-counting mode). There are 3 possible options for flag setting in center-aligned mode, refer to the CMS bits in the TIMx_CR1 register for the full description. If channel CC1 is configured as input: this bit is set when counter value has been captured in TIMx_CCR1 register (an edge has been detected on IC1, as per the edge sensitivity defined with the CC1P and CC1NP bits setting, in TIMx_CCER)..
Allowed values:
0x0: B_0x0: No compare match / No input capture occurred
0x1: B_0x1: A compare match or an input capture occurred.
Bit 9: Capture/Compare 1 overcapture flag This flag is set by hardware only when the corresponding channel is configured in input capture mode. It is cleared by software by writing it to '0â..
Allowed values:
0x0: B_0x0: No overcapture has been detected.
0x1: B_0x1: The counter value has been captured in TIMx_CCR1 register while CC1IF flag was already set
event generation register
Offset: 0x14, reset: 0x0000, access: write-only
2/2 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
CC1G
w |
UG
w |
||||||||||||||
Bit 0: Update generation This bit can be set by software, it is automatically cleared by hardware..
Allowed values:
0x0: B_0x0: No action
0x1: B_0x1: Re-initialize the counter and generates an update of the registers. Note that the prescaler counter is cleared too (anyway the prescaler ratio is not affected). The counter is cleared.
Bit 1: Capture/compare 1 generation This bit is set by software in order to generate an event, it is automatically cleared by hardware. If channel CC1 is configured as output: CC1IF flag is set, Corresponding interrupt or is sent if enabled. If channel CC1 is configured as input: The current value of the counter is captured in TIMx_CCR1 register. The CC1IF flag is set, the corresponding interrupt is sent if enabled. The CC1OF flag is set if the CC1IF flag was already high..
Allowed values:
0x0: B_0x0: No action
0x1: B_0x1: A capture/compare event is generated on channel 1:
capture/compare mode register 1 (input mode)
Offset: 0x18, reset: 0x00000000, access: read-write
3/3 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
IC1F
rw |
IC1PSC
rw |
CC1S
rw |
|||||||||||||
Bits 0-1: Capture/Compare 1 selection This bit-field defines the direction of the channel (input/output) as well as the used input. Note: CC1S bits are writable only when the channel is OFF (CC1E = 0 in TIMx_CCER)..
Allowed values:
0x0: B_0x0: CC1 channel is configured as output
0x1: B_0x1: CC1 channel is configured as input, IC1 is mapped on TI1
Bits 2-3: Input capture 1 prescaler This bit-field defines the ratio of the prescaler acting on CC1 input (IC1). The prescaler is reset as soon as CC1E=â0â (TIMx_CCER register)..
Allowed values:
0x0: B_0x0: no prescaler, capture is done each time an edge is detected on the capture input
0x1: B_0x1: capture is done once every 2 events
0x2: B_0x2: capture is done once every 4 events
0x3: B_0x3: capture is done once every 8 events
Bits 4-7: Input capture 1 filter This bit-field defines the frequency used to sample TI1 input and the length of the digital filter applied to TI1. The digital filter is made of an event counter in which N consecutive events are needed to validate a transition on the output:.
Allowed values:
0x0: B_0x0: No filter, sampling is done at fDTS
0x1: B_0x1: fSAMPLING=fCK_INT, N=2
0x2: B_0x2: fSAMPLING=fCK_INT, N=4
0x3: B_0x3: fSAMPLING=fCK_INT, N=8
0x4: B_0x4: fSAMPLING=fDTS/2, N=6
0x5: B_0x5: fSAMPLING=fDTS/2, N=8
0x6: B_0x6: fSAMPLING=fDTS/4, N=6
0x7: B_0x7: fSAMPLING=fDTS/4, N=8
0x8: B_0x8: fSAMPLING=fDTS/8, N=6
0x9: B_0x9: fSAMPLING=fDTS/8, N=8
0xA: B_0xA: fSAMPLING=fDTS/16, N=5
0xB: B_0xB: fSAMPLING=fDTS/16, N=6
0xC: B_0xC: fSAMPLING=fDTS/16, N=8
0xD: B_0xD: fSAMPLING=fDTS/32, N=5
0xE: B_0xE: fSAMPLING=fDTS/32, N=6
0xF: B_0xF: fSAMPLING=fDTS/32, N=8
capture/compare mode register 1 (output mode)
Offset: 0x18, reset: 0x00000000, access: read-write
4/5 fields covered.
Bits 0-1: Capture/Compare 1 selection This bit-field defines the direction of the channel (input/output) as well as the used input. Note: CC1S bits are writable only when the channel is OFF (CC1E = 0 in TIMx_CCER)..
Allowed values:
0x0: B_0x0: CC1 channel is configured as output.
0x1: B_0x1: CC1 channel is configured as input, IC1 is mapped on TI1.
Bit 2: Output compare 1 fast enable This bit decreases the latency between a trigger event and a transition on the timer output. It must be used in one-pulse mode (OPM bit set in TIMx_CR1 register), to have the output pulse starting as soon as possible after the starting trigger..
Allowed values:
0x0: B_0x0: CC1 behaves normally depending on counter and CCR1 values even when the trigger is ON. The minimum delay to activate CC1 output when an edge occurs on the trigger input is 5 clock cycles.
0x1: B_0x1: An active edge on the trigger input acts like a compare match on CC1 output. OC is then set to the compare level independently of the result of the comparison. Delay to sample the trigger input and to activate CC1 output is reduced to 3 clock cycles. OC1FE acts only if the channel is configured in PWM1 or PWM2 mode.
Bit 3: Output compare 1 preload enable Note: The PWM mode can be used without validating the preload register only in one pulse mode (OPM bit set in TIMx_CR1 register). Else the behavior is not guaranteed..
Allowed values:
0x0: B_0x0: Preload register on TIMx_CCR1 disabled. TIMx_CCR1 can be written at anytime, the new value is taken in account immediately.
0x1: B_0x1: Preload register on TIMx_CCR1 enabled. Read/Write operations access the preload register. TIMx_CCR1 preload value is loaded in the active register at each update event.
Bits 4-6: Output compare 1 mode (refer to bit 16 for OC1M[3]) These bits define the behavior of the output reference signal OC1REF from which OC1 is derived. OC1REF is active high whereas OC1 active level depends on CC1P bit. Others: Reserved Note: In PWM mode 1 or 2, the OCREF level changes when the result of the comparison changes or when the output compare mode switches from frozen to PWM mode. Note: The OC1M[3] bit is not contiguous, located in bit 16..
Allowed values:
0: Frozen: The comparison between the output compare register TIMx_CCRy and the counter TIMx_CNT has no effect on the outputs
1: ActiveOnMatch: Set channel to active level on match. OCyREF signal is forced high when the counter matches the capture/compare register
2: InactiveOnMatch: Set channel to inactive level on match. OCyREF signal is forced low when the counter matches the capture/compare register
3: Toggle: OCyREF toggles when TIMx_CNT=TIMx_CCRy
4: ForceInactive: OCyREF is forced low
5: ForceActive: OCyREF is forced high
6: PwmMode1: In upcounting, channel is active as long as TIMx_CNT
7: PwmMode2: Inversely to PwmMode1
Bit 16: Output compare 1 mode (refer to bit 16 for OC1M[3]) These bits define the behavior of the output reference signal OC1REF from which OC1 is derived. OC1REF is active high whereas OC1 active level depends on CC1P bit. Others: Reserved Note: In PWM mode 1 or 2, the OCREF level changes when the result of the comparison changes or when the output compare mode switches from frozen to PWM mode. Note: The OC1M[3] bit is not contiguous, located in bit 16..
capture/compare enable register
Offset: 0x20, reset: 0x0000, access: read-write
2/3 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
CC1NP
rw |
CC1P
rw |
CC1E
rw |
|||||||||||||
Bit 1: Capture/Compare 1 output Polarity. When CC1 channel is configured as input, both CC1NP/CC1P bits select the active polarity of TI1FP1 and TI2FP1 for trigger or capture operations. CC1NP=0, CC1P=0: non-inverted/rising edge. The circuit is sensitive to TIxFP1 rising edge (capture or trigger operations in reset, external clock or trigger mode), TIxFP1 is not inverted (trigger operation in gated mode or encoder mode). CC1NP=0, CC1P=1: inverted/falling edge. The circuit is sensitive to TIxFP1 falling edge (capture or trigger operations in reset, external clock or trigger mode), TIxFP1 is inverted (trigger operation in gated mode or encoder mode). CC1NP=1, CC1P=1: non-inverted/both edges/ The circuit is sensitive to both TIxFP1 rising and falling edges (capture or trigger operations in reset, external clock or trigger mode), TIxFP1is not inverted (trigger operation in gated mode). This configuration must not be used in encoder mode. CC1NP=1, CC1P=0: This configuration is reserved, it must not be used..
Allowed values:
0x0: B_0x0: OC1 active high (output mode) / Edge sensitivity selection (input mode, see below)
0x1: B_0x1: OC1 active low (output mode) / Edge sensitivity selection (input mode, see below)
counter
Offset: 0x24, reset: 0x00000000, access: read-write
0/2 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
UIFCPY
rw |
|||||||||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
CNT
rw |
|||||||||||||||
prescaler
Offset: 0x28, reset: 0x0000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
PSC
rw |
|||||||||||||||
auto-reload register
Offset: 0x2C, reset: 0x00000000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
ARR
rw |
|||||||||||||||
capture/compare register 1
Offset: 0x34, reset: 0x00000000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
CCR1
rw |
|||||||||||||||
TIM timer input selection register
Offset: 0x68, reset: 0x0000, access: read-write
1/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
TI1SEL
rw |
|||||||||||||||
0x40014000: General purpose timers
73/97 fields covered. Toggle Registers
| Offset | Name | 31 |
30 |
29 |
28 |
27 |
26 |
25 |
24 |
23 |
22 |
21 |
20 |
19 |
18 |
17 |
16 |
15 |
14 |
13 |
12 |
11 |
10 |
9 |
8 |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x0 | CR1 | ||||||||||||||||||||||||||||||||
| 0x4 | CR2 | ||||||||||||||||||||||||||||||||
| 0x8 | SMCR | ||||||||||||||||||||||||||||||||
| 0xC | DIER | ||||||||||||||||||||||||||||||||
| 0x10 | SR | ||||||||||||||||||||||||||||||||
| 0x14 | EGR | ||||||||||||||||||||||||||||||||
| 0x18 | CCMR1_Input | ||||||||||||||||||||||||||||||||
| 0x18 | CCMR1_Output | ||||||||||||||||||||||||||||||||
| 0x20 | CCER | ||||||||||||||||||||||||||||||||
| 0x24 | CNT | ||||||||||||||||||||||||||||||||
| 0x28 | PSC | ||||||||||||||||||||||||||||||||
| 0x2C | ARR | ||||||||||||||||||||||||||||||||
| 0x30 | RCR | ||||||||||||||||||||||||||||||||
| 0x34 | CCR1 | ||||||||||||||||||||||||||||||||
| 0x38 | CCR2 | ||||||||||||||||||||||||||||||||
| 0x44 | BDTR | ||||||||||||||||||||||||||||||||
| 0x48 | DCR | ||||||||||||||||||||||||||||||||
| 0x4C | DMAR | ||||||||||||||||||||||||||||||||
| 0x60 | AF1 | ||||||||||||||||||||||||||||||||
| 0x68 | TISEL | ||||||||||||||||||||||||||||||||
control register 1
Offset: 0x0, reset: 0x0000, access: read-write
7/7 fields covered.
Bit 1: Update disable This bit is set and cleared by software to enable/disable UEV event generation. Counter overflow/underflow Setting the UG bit Update generation through the slave mode controller Buffered registers are then loaded with their preload values..
Allowed values:
0x0: B_0x0: UEV enabled. The Update (UEV) event is generated by one of the following events:
0x1: B_0x1: UEV disabled. The Update event is not generated, shadow registers keep their value (ARR, PSC, CCRx). However the counter and the prescaler are reinitialized if the UG bit is set or if a hardware reset is received from the slave mode controller.
Bit 2: Update request source This bit is set and cleared by software to select the UEV event sources. Counter overflow/underflow Setting the UG bit Update generation through the slave mode controller.
Allowed values:
0x0: B_0x0: Any of the following events generate an update interrupt if enabled. These events can be:
0x1: B_0x1: Only counter overflow/underflow generates an update interrupt if enabled
Bits 8-9: Clock division This bitfield indicates the division ratio between the timer clock (CK_INT) frequency and the dead-time and sampling clock (tDTS) used by the dead-time generators and the digital filters (TIx).
Allowed values:
0x0: B_0x0: tDTS = tCK_INT
0x1: B_0x1: tDTS = 2*tCK_INT
0x2: B_0x2: tDTS = 4*tCK_INT
0x3: B_0x3: Reserved, do not program this value
control register 2
Offset: 0x4, reset: 0x0000, access: read-write
8/8 fields covered.
Bit 0: Capture/compare preloaded control Note: This bit acts only on channels that have a complementary output..
Allowed values:
0x0: B_0x0: CCxE, CCxNE and OCxM bits are not preloaded
0x1: B_0x1: CCxE, CCxNE and OCxM bits are preloaded, after having been written, they are updated only when a commutation event (COM) occurs (COMG bit set or rising edge detected on TRGI, depending on the CCUS bit).
Bit 2: Capture/compare control update selection Note: This bit acts only on channels that have a complementary output..
Allowed values:
0x0: B_0x0: When capture/compare control bits are preloaded (CCPC=1), they are updated by setting the COMG bit only.
0x1: B_0x1: When capture/compare control bits are preloaded (CCPC=1), they are updated by setting the COMG bit or when an rising edge occurs on TRGI.
Bits 4-6: Master mode selection These bits allow to select the information to be sent in master mode to slave timers for synchronization (TRGO). The combination is as follows:.
Allowed values:
0x0: B_0x0: Reset - the UG bit from the TIMx_EGR register is used as trigger output (TRGO). If the reset is generated by the trigger input (slave mode controller configured in reset mode) then the signal on TRGO is delayed compared to the actual reset.
0x1: B_0x1: Enable - the Counter Enable signal CNT_EN is used as trigger output (TRGO). It is useful to start several timers at the same time or to control a window in which a slave timer is enable. The Counter Enable signal is generated by a logic AND between CEN control bit and the trigger input when configured in gated mode. When the Counter Enable signal is controlled by the trigger input, there is a delay on TRGO, except if the master/slave mode is selected (see the MSM bit description in TIMx_SMCR register).
0x2: B_0x2: Update - The update event is selected as trigger output (TRGO). For instance a master timer can then be used as a prescaler for a slave timer.
0x3: B_0x3: Compare Pulse - The trigger output send a positive pulse when the CC1IF flag is to be set (even if it was already high), as soon as a capture or a compare match occurred. (TRGO).
0x4: B_0x4: Compare - OC1REFC signal is used as trigger output (TRGO).
0x5: B_0x5: Compare - OC2REFC signal is used as trigger output (TRGO).
Bit 8: Output Idle state 1 (OC1 output) Note: This bit can not be modified as long as LOCK level 1, 2 or 3 has been programmed (LOCK bits in TIM15_BDTR register)..
Allowed values:
0x0: B_0x0: OC1=0 (after a dead-time if OC1N is implemented) when MOE=0
0x1: B_0x1: OC1=1 (after a dead-time if OC1N is implemented) when MOE=0
slave mode control register
Offset: 0x8, reset: 0x0000, access: read-write
1/5 fields covered.
Bits 0-2: Slave mode selection When external signals are selected the active edge of the trigger signal (TRGI) is linked to the polarity selected on the external input (see Input Control register and Control Register description. Other codes: reserved. Note: The gated mode must not be used if TI1F_ED is selected as the trigger input (TS=â00100â). Indeed, TI1F_ED outputs 1 pulse for each transition on TI1F, whereas the gated mode checks the level of the trigger signal. Note: The clock of the slave peripherals (timer, ADC, ...) receiving the TRGO or the TRGO2 signals must be enabled prior to receive events from the master timer, and the clock frequency (prescaler) must not be changed on-the-fly while triggers are received from the master timer..
Bits 4-6: Trigger selection This bit field selects the trigger input to be used to synchronize the counter. Other: Reserved See for more details on ITRx meaning for each Timer. Note: These bits must be changed only when they are not used (e.g. when SMS=000) to avoid wrong edge detections at the transition..
Bit 7: Master/slave mode.
Allowed values:
0x0: B_0x0: No action
0x1: B_0x1: The effect of an event on the trigger input (TRGI) is delayed to allow a perfect synchronization between the current timer and its slaves (through TRGO). It is useful if we want to synchronize several timers on a single external event.
Bit 16: Slave mode selection When external signals are selected the active edge of the trigger signal (TRGI) is linked to the polarity selected on the external input (see Input Control register and Control Register description. Other codes: reserved. Note: The gated mode must not be used if TI1F_ED is selected as the trigger input (TS=â00100â). Indeed, TI1F_ED outputs 1 pulse for each transition on TI1F, whereas the gated mode checks the level of the trigger signal. Note: The clock of the slave peripherals (timer, ADC, ...) receiving the TRGO or the TRGO2 signals must be enabled prior to receive events from the master timer, and the clock frequency (prescaler) must not be changed on-the-fly while triggers are received from the master timer..
Bits 20-21: Trigger selection This bit field selects the trigger input to be used to synchronize the counter. Other: Reserved See for more details on ITRx meaning for each Timer. Note: These bits must be changed only when they are not used (e.g. when SMS=000) to avoid wrong edge detections at the transition..
status register
Offset: 0x10, reset: 0x0000, access: read-write
6/8 fields covered.
Bit 0: Update interrupt flag This bit is set by hardware on an update event. It is cleared by software. At overflow regarding the repetition counter value (update if repetition counter = 0) and if the UDIS=0 in the TIMx_CR1 register. When CNT is reinitialized by software using the UG bit in TIMx_EGR register, if URS=0 and UDIS=0 in the TIMx_CR1 register. When CNT is reinitialized by a trigger event (refer to control register (TIM15_SMCR)), if URS=0 and UDIS=0 in the TIMx_CR1 register..
Allowed values:
0x0: B_0x0: No update occurred.
0x1: B_0x1: Update interrupt pending. This bit is set by hardware when the registers are updated:
Bit 1: Capture/Compare 1 interrupt flag This flag is set by hardware. It is cleared by software (input capture or output compare mode) or by reading the TIMx_CCR1 register (input capture mode only). If channel CC1 is configured as output: this flag is set when the content of the counter TIMx_CNT matches the content of the TIMx_CCR1 register. When the content of TIMx_CCR1 is greater than the content of TIMx_ARR, the CC1IF bit goes high on the counter overflow (in up-counting and up/down-counting modes) or underflow (in down-counting mode). There are 3 possible options for flag setting in center-aligned mode, refer to the CMS bits in the TIMx_CR1 register for the full description. If channel CC1 is configured as input: this bit is set when counter value has been captured in TIMx_CCR1 register (an edge has been detected on IC1, as per the edge sensitivity defined with the CC1P and CC1NP bits setting, in TIMx_CCER)..
Allowed values:
0x0: B_0x0: No compare match / No input capture occurred
0x1: B_0x1: A compare match or an input capture occurred
Bit 6: Trigger interrupt flag This flag is set by hardware on the TRG trigger event (active edge detected on TRGI input when the slave mode controller is enabled in all modes but gated mode, both edges in case gated mode is selected). It is set when the counter starts or stops when gated mode is selected. It is cleared by software..
Allowed values:
0x0: B_0x0: No trigger event occurred
0x1: B_0x1: Trigger interrupt pending
Bit 9: Capture/Compare 1 overcapture flag This flag is set by hardware only when the corresponding channel is configured in input capture mode. It is cleared by software by writing it to '0â..
Allowed values:
0x0: B_0x0: No overcapture has been detected
0x1: B_0x1: The counter value has been captured in TIMx_CCR1 register while CC1IF flag was already set
event generation register
Offset: 0x14, reset: 0x0000, access: write-only
5/6 fields covered.
Bit 0: Update generation This bit can be set by software, it is automatically cleared by hardware..
Allowed values:
0x0: B_0x0: No action
0x1: B_0x1: Reinitialize the counter and generates an update of the registers. Note that the prescaler counter is cleared too (anyway the prescaler ratio is not affected).
Bit 1: Capture/Compare 1 generation This bit is set by software in order to generate an event, it is automatically cleared by hardware. If channel CC1 is configured as output: CC1IF flag is set, Corresponding interrupt or DMA request is sent if enabled. If channel CC1 is configured as input: The current value of the counter is captured in TIMx_CCR1 register. The CC1IF flag is set, the corresponding interrupt or DMA request is sent if enabled. The CC1OF flag is set if the CC1IF flag was already high..
Allowed values:
0x0: B_0x0: No action
0x1: B_0x1: A capture/compare event is generated on channel 1:
Bit 5: Capture/Compare control update generation This bit can be set by software, it is automatically cleared by hardware. Note: This bit acts only on channels that have a complementary output..
Allowed values:
0x0: B_0x0: No action
0x1: B_0x1: When the CCPC bit is set, it is possible to update the CCxE, CCxNE and OCxM bits
capture/compare mode register 1 (input mode)
Offset: 0x18, reset: 0x00000000, access: read-write
4/6 fields covered.
Bits 0-1: Capture/Compare 1 Selection This bit-field defines the direction of the channel (input/output) as well as the used input. Note: CC1S bits are writable only when the channel is OFF (CC1E = '0â in TIMx_CCER)..
Allowed values:
0x0: B_0x0: CC1 channel is configured as output
0x1: B_0x1: CC1 channel is configured as input, IC1 is mapped on TI1
0x2: B_0x2: CC1 channel is configured as input, IC1 is mapped on TI2
0x3: B_0x3: CC1 channel is configured as input, IC1 is mapped on TRC. This mode is working only if an internal trigger input is selected through TS bit (TIMx_SMCR register)
Bits 2-3: Input capture 1 prescaler This bit-field defines the ratio of the prescaler acting on CC1 input (IC1). The prescaler is reset as soon as CC1E=â0â (TIMx_CCER register)..
Allowed values:
0x0: B_0x0: no prescaler, capture is done each time an edge is detected on the capture input
0x1: B_0x1: capture is done once every 2 events
0x2: B_0x2: capture is done once every 4 events
0x3: B_0x3: capture is done once every 8 events
Bits 4-7: Input capture 1 filter This bit-field defines the frequency used to sample TI1 input and the length of the digital filter applied to TI1. The digital filter is made of an event counter in which N consecutive events are needed to validate a transition on the output:.
Allowed values:
0x0: B_0x0: No filter, sampling is done at fDTS
0x1: B_0x1: fSAMPLING=fCK_INT, N=2
0x2: B_0x2: fSAMPLING=fCK_INT, N=4
0x3: B_0x3: fSAMPLING=fCK_INT, N=8
0x4: B_0x4: fSAMPLING=fDTS/2, N=6
0x5: B_0x5: fSAMPLING=fDTS/2, N=8
0x6: B_0x6: fSAMPLING=fDTS/4, N=6
0x7: B_0x7: fSAMPLING=fDTS/4, N=8
0x8: B_0x8: fSAMPLING=fDTS/8, N=6
0x9: B_0x9: fSAMPLING=fDTS/8, N=8
0xA: B_0xA: fSAMPLING=fDTS/16, N=5
0xB: B_0xB: fSAMPLING=fDTS/16, N=6
0xC: B_0xC: fSAMPLING=fDTS/16, N=8
0xD: B_0xD: fSAMPLING=fDTS/32, N=5
0xE: B_0xE: fSAMPLING=fDTS/32, N=6
0xF: B_0xF: fSAMPLING=fDTS/32, N=8
Bits 8-9: Capture/Compare 2 selection This bit-field defines the direction of the channel (input/output) as well as the used input. Note: CC2S bits are writable only when the channel is OFF (CC2E = '0â in TIMx_CCER)..
Allowed values:
0x0: B_0x0: CC2 channel is configured as output
0x1: B_0x1: CC2 channel is configured as input, IC2 is mapped on TI2
0x2: B_0x2: CC2 channel is configured as input, IC2 is mapped on TI1
0x3: B_0x3: CC2 channel is configured as input, IC2 is mapped on TRC. This mode is working only if an internal trigger input is selected through TS bit (TIMx_SMCR register)
capture/compare mode register (output mode)
Offset: 0x18, reset: 0x00000000, access: read-write
6/10 fields covered.
Bits 0-1: Capture/Compare 1 selection This bit-field defines the direction of the channel (input/output) as well as the used input. Note: CC1S bits are writable only when the channel is OFF (CC1E = '0â in TIMx_CCER)..
Allowed values:
0x0: B_0x0: CC1 channel is configured as output.
0x1: B_0x1: CC1 channel is configured as input, IC1 is mapped on TI1.
0x2: B_0x2: CC1 channel is configured as input, IC1 is mapped on TI2.
0x3: B_0x3: CC1 channel is configured as input, IC1 is mapped on TRC. This mode is working only if an internal trigger input is selected through TS bit (TIMx_SMCR register)
Bit 2: Output Compare 1 fast enable This bit decreases the latency between a trigger event and a transition on the timer output. It must be used in one-pulse mode (OPM bit set in TIMx_CR1 register), to have the output pulse starting as soon as possible after the starting trigger..
Allowed values:
0x0: B_0x0: CC1 behaves normally depending on counter and CCR1 values even when the trigger is ON. The minimum delay to activate CC1 output when an edge occurs on the trigger input is 5 clock cycles.
0x1: B_0x1: An active edge on the trigger input acts like a compare match on CC1 output. Then, OC is set to the compare level independently of the result of the comparison. Delay to sample the trigger input and to activate CC1 output is reduced to 3 clock cycles. OCFE acts only if the channel is configured in PWM1 or PWM2 mode.
Bit 3: Output Compare 1 preload enable Note: These bits can not be modified as long as LOCK level 3 has been programmed (LOCK bits in TIMx_BDTR register) and CC1S=â00â (the channel is configured in output). The PWM mode can be used without validating the preload register only in one pulse mode (OPM bit set in TIMx_CR1 register). Else the behavior is not guaranteed..
Allowed values:
0x0: B_0x0: Preload register on TIMx_CCR1 disabled. TIMx_CCR1 can be written at anytime, the new value is taken in account immediately.
0x1: B_0x1: Preload register on TIMx_CCR1 enabled. Read/Write operations access the preload register. TIMx_CCR1 preload value is loaded in the active register at each update event.
Bits 4-6: Output Compare 1 mode These bits define the behavior of the output reference signal OC1REF from which OC1 and OC1N are derived. OC1REF is active high whereas OC1 and OC1N active level depends on CC1P and CC1NP bits. Note: These bits can not be modified as long as LOCK level 3 has been programmed (LOCK bits in TIMx_BDTR register) and CC1S=â00â (the channel is configured in output). In PWM mode, the OCREF level changes only when the result of the comparison changes or when the output compare mode switches from âfrozenâ mode to âPWMâ mode. On channels that have a complementary output, this bit field is preloaded. If the CCPC bit is set in the TIMx_CR2 register then the OC1M active bits take the new value from the preloaded bits only when a COM event is generated. The OC1M[3] bit is not contiguous, located in bit 16..
Bits 8-9: Capture/Compare 2 selection This bit-field defines the direction of the channel (input/output) as well as the used input. Note: CC2S bits are writable only when the channel is OFF (CC2E = '0â in TIMx_CCER)..
Allowed values:
0x0: B_0x0: CC2 channel is configured as output.
0x1: B_0x1: CC2 channel is configured as input, IC2 is mapped on TI2.
0x2: B_0x2: CC2 channel is configured as input, IC2 is mapped on TI1.
0x3: B_0x3: CC2 channel is configured as input, IC2 is mapped on TRC. This mode is working only if an internal trigger input is selected through the TS bit (TIMx_SMCR register)
Bits 12-14: Output Compare 2 mode.
Allowed values:
0: Frozen: The comparison between the output compare register TIMx_CCRy and the counter TIMx_CNT has no effect on the outputs / OpmMode1: Retriggerable OPM mode 1 - In up-counting mode, the channel is active until a trigger event is detected (on TRGI signal). In down-counting mode, the channel is inactive
1: ActiveOnMatch: Set channel to active level on match. OCyREF signal is forced high when the counter matches the capture/compare register / OpmMode2: Inversely to OpmMode1
2: InactiveOnMatch: Set channel to inactive level on match. OCyREF signal is forced low when the counter matches the capture/compare register / Reserved
3: Toggle: OCyREF toggles when TIMx_CNT=TIMx_CCRy / Reserved
4: ForceInactive: OCyREF is forced low / CombinedPwmMode1: OCyREF has the same behavior as in PWM mode 1. OCyREFC is the logical OR between OC1REF and OC2REF
5: ForceActive: OCyREF is forced high / CombinedPwmMode2: OCyREF has the same behavior as in PWM mode 2. OCyREFC is the logical AND between OC1REF and OC2REF
6: PwmMode1: In upcounting, channel is active as long as TIMx_CNT
7: PwmMode2: Inversely to PwmMode1 / Reserved
Bit 16: Output Compare 1 mode These bits define the behavior of the output reference signal OC1REF from which OC1 and OC1N are derived. OC1REF is active high whereas OC1 and OC1N active level depends on CC1P and CC1NP bits. Note: These bits can not be modified as long as LOCK level 3 has been programmed (LOCK bits in TIMx_BDTR register) and CC1S=â00â (the channel is configured in output). In PWM mode, the OCREF level changes only when the result of the comparison changes or when the output compare mode switches from âfrozenâ mode to âPWMâ mode. On channels that have a complementary output, this bit field is preloaded. If the CCPC bit is set in the TIMx_CR2 register then the OC1M active bits take the new value from the preloaded bits only when a COM event is generated. The OC1M[3] bit is not contiguous, located in bit 16..
capture/compare enable register
Offset: 0x20, reset: 0x0000, access: read-write
4/7 fields covered.
Bit 0: Capture/Compare 1 output enable When CC1 channel is configured as output, the OC1 level depends on MOE, OSSI, OSSR, OIS1, OIS1N and CC1NE bits, regardless of the CC1E bits state. Refer to for details..
Allowed values:
0x0: B_0x0: Capture mode disabled / OC1 is not active (see below)
0x1: B_0x1: Capture mode enabled / OC1 signal is output on the corresponding output pin
Bit 1: Capture/Compare 1 output polarity When CC1 channel is configured as input, both CC1NP/CC1P bits select the active polarity of TI1FP1 and TI2FP1 for trigger or capture operations. CC1NP=0, CC1P=0: non-inverted/rising edge. The circuit is sensitive to TIxFP1 rising edge (capture or trigger operations in reset, external clock or trigger mode), TIxFP1 is not inverted (trigger operation in gated mode or encoder mode). CC1NP=0, CC1P=1: inverted/falling edge. The circuit is sensitive to TIxFP1 falling edge (capture or trigger operations in reset, external clock or trigger mode), TIxFP1 is inverted (trigger operation in gated mode or encoder mode). CC1NP=1, CC1P=1: non-inverted/both edges/ The circuit is sensitive to both TIxFP1 rising and falling edges (capture or trigger operations in reset, external clock or trigger mode), TIxFP1is not inverted (trigger operation in gated mode). This configuration must not be used in encoder mode. CC1NP=1, CC1P=0: this configuration is reserved, it must not be used. Note: This bit is not writable as soon as LOCK level 2 or 3 has been programmed (LOCK bits in TIMx_BDTR register). On channels that have a complementary output, this bit is preloaded. If the CCPC bit is set in the TIMx_CR2 register then the CC1P active bit takes the new value from the preloaded bit only when a Commutation event is generated..
Allowed values:
0x0: B_0x0: OC1 active high (output mode) / Edge sensitivity selection (input mode, see below)
0x1: B_0x1: OC1 active low (output mode) / Edge sensitivity selection (input mode, see below)
Bit 2: Capture/Compare 1 complementary output enable.
Allowed values:
0x0: B_0x0: Off - OC1N is not active. OC1N level is then function of MOE, OSSI, OSSR, OIS1, OIS1N and CC1E bits.
0x1: B_0x1: On - OC1N signal is output on the corresponding output pin depending on MOE, OSSI, OSSR, OIS1, OIS1N and CC1E bits.
Bit 3: Capture/Compare 1 complementary output polarity CC1 channel configured as output: CC1 channel configured as input: This bit is used in conjunction with CC1P to define the polarity of TI1FP1 and TI2FP1. Refer to CC1P description. Note: This bit is not writable as soon as LOCK level 2 or 3 has been programmed (LOCK bits in TIMx_BDTR register) and CC1S=â00â (the channel is configured in output). On channels that have a complementary output, this bit is preloaded. If the CCPC bit is set in the TIMx_CR2 register then the CC1NP active bit takes the new value from the preloaded bit only when a Commutation event is generated..
Allowed values:
0x0: B_0x0: OC1N active high
0x1: B_0x1: OC1N active low
counter
Offset: 0x24, reset: 0x00000000, access: Unspecified
1/2 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
UIFCPY
r |
|||||||||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
CNT
rw |
|||||||||||||||
prescaler
Offset: 0x28, reset: 0x0000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
PSC
rw |
|||||||||||||||
auto-reload register
Offset: 0x2C, reset: 0x0000FFFF, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
ARR
rw |
|||||||||||||||
repetition counter register
Offset: 0x30, reset: 0x0000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
REP
rw |
|||||||||||||||
capture/compare register 1
Offset: 0x34, reset: 0x00000000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
CCR1
rw |
|||||||||||||||
capture/compare register 2
Offset: 0x38, reset: 0x00000000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
CCR2
rw |
|||||||||||||||
break and dead-time register
Offset: 0x44, reset: 0x0000, access: read-write
10/11 fields covered.
Bits 0-7: Dead-time generator setup This bit-field defines the duration of the dead-time inserted between the complementary outputs. DT correspond to this duration. DTG[7:5]=0xx => DT=DTG[7:0]x tdtg with tdtg=tDTS DTG[7:5]=10x => DT=(64+DTG[5:0])xtdtg with Tdtg=2xtDTS DTG[7:5]=110 => DT=(32+DTG[4:0])xtdtg with Tdtg=8xtDTS DTG[7:5]=111 => DT=(32+DTG[4:0])xtdtg with Tdtg=16xtDTS Example if TDTS=125ns (8MHz), dead-time possible values are: 0 to 15875 ns by 125 ns steps, 16 µs to 31750 ns by 250 ns steps, 32 µs to 63 µs by 1 µs steps, 64 µs to 126 µs by 2 µs steps Note: This bit-field can not be modified as long as LOCK level 1, 2 or 3 has been programmed (LOCK bits in TIMx_BDTR register)..
Bits 8-9: Lock configuration These bits offer a write protection against software errors. Note: The LOCK bits can be written only once after the reset. Once the TIMx_BDTR register has been written, their content is frozen until the next reset..
Allowed values:
0x0: B_0x0: LOCK OFF - No bit is write protected
0x1: B_0x1: LOCK Level 1 = DTG bits in TIMx_BDTR register, OISx and OISxN bits in TIMx_CR2 register and BKE/BKP/AOE bits in TIMx_BDTR register can no longer be written
0x2: B_0x2: LOCK Level 2 = LOCK Level 1 + CC Polarity bits (CCxP/CCxNP bits in TIMx_CCER register, as long as the related channel is configured in output through the CCxS bits) as well as OSSR and OSSI bits can no longer be written.
0x3: B_0x3: LOCK Level 3 = LOCK Level 2 + CC Control bits (OCxM and OCxPE bits in TIMx_CCMRx registers, as long as the related channel is configured in output through the CCxS bits) can no longer be written.
Bit 10: Off-state selection for Idle mode This bit is used when MOE=0 on channels configured as outputs. See OC/OCN enable description for more details (enable register (TIM15_CCER) on page 818). Note: This bit can not be modified as soon as the LOCK level 2 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: When inactive, OC/OCN outputs are disabled (OC/OCN enable output signal=0)
0x1: B_0x1: When inactive, OC/OCN outputs are forced first with their idle level as soon as CCxE=1 or CCxNE=1. OC/OCN enable output signal=1)
Bit 11: Off-state selection for Run mode This bit is used when MOE=1 on channels that have a complementary output which are configured as outputs. OSSR is not implemented if no complementary output is implemented in the timer. See OC/OCN enable description for more details (enable register (TIM15_CCER) on page 818). Note: This bit can not be modified as soon as the LOCK level 2 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: When inactive, OC/OCN outputs are disabled (the timer releases the output control which is taken over by the AFIO logic, which forces a Hi-Z state)
0x1: B_0x1: When inactive, OC/OCN outputs are enabled with their inactive level as soon as CCxE=1 or CCxNE=1 (the output is still controlled by the timer).
Bit 12: Break enable 1; Break inputs (BRK and CCS clock failure event) enabled This bit cannot be modified when LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register). Note: Any write operation to this bit takes a delay of 1 APB clock cycle to become effective..
Allowed values:
0x0: B_0x0: Break inputs (BRK and CCS clock failure event) disabled
Bit 13: Break polarity Note: This bit can not be modified as long as LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register). Any write operation to this bit takes a delay of 1 APB clock cycle to become effective..
Allowed values:
0x0: B_0x0: Break input BRK is active low
0x1: B_0x1: Break input BRK is active high
Bit 14: Automatic output enable Note: This bit can not be modified as long as LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: MOE can be set only by software
0x1: B_0x1: MOE can be set by software or automatically at the next update event (if the break input is not be active)
Bit 15: Main output enable This bit is cleared asynchronously by hardware as soon as the break input is active. It is set by software or automatically depending on the AOE bit. It is acting only on the channels which are configured in output. See OC/OCN enable description for more details (enable register (TIM15_CCER) on page 818)..
Allowed values:
0x0: B_0x0: OC and OCN outputs are disabled or forced to idle state depending on the OSSI bit.
0x1: B_0x1: OC and OCN outputs are enabled if their respective enable bits are set (CCxE, CCxNE in TIMx_CCER register)
Bits 16-19: Break filter This bit-field defines the frequency used to sample the BRK input signal and the length of the digital filter applied to BRK. The digital filter is made of an event counter in which N events are needed to validate a transition on the output: Note: This bit cannot be modified when LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: No filter, BRK acts asynchronously
0x1: B_0x1: fSAMPLING=fCK_INT, N=2
0x2: B_0x2: fSAMPLING=fCK_INT, N=4
0x3: B_0x3: fSAMPLING=fCK_INT, N=8
0x4: B_0x4: fSAMPLING=fDTS/2, N=6
0x5: B_0x5: fSAMPLING=fDTS/2, N=8
0x6: B_0x6: fSAMPLING=fDTS/4, N=6
0x7: B_0x7: fSAMPLING=fDTS/4, N=8
0x8: B_0x8: fSAMPLING=fDTS/8, N=6
0x9: B_0x9: fSAMPLING=fDTS/8, N=8
0xA: B_0xA: fSAMPLING=fDTS/16, N=5
0xB: B_0xB: fSAMPLING=fDTS/16, N=6
0xC: B_0xC: fSAMPLING=fDTS/16, N=8
0xD: B_0xD: fSAMPLING=fDTS/32, N=5
0xE: B_0xE: fSAMPLING=fDTS/32, N=6
0xF: B_0xF: fSAMPLING=fDTS/32, N=8
Bit 26: Break Disarm This bit is cleared by hardware when no break source is active. The BKDSRM bit must be set by software to release the bidirectional output control (open-drain output in Hi-Z state) and then be polled it until it is reset by hardware, indicating that the fault condition has disappeared. Note: Any write operation to this bit takes a delay of 1 APB clock cycle to become effective..
Allowed values:
0x0: B_0x0: Break input BRK is armed
0x1: B_0x1: Break input BRK is disarmed
Bit 28: Break Bidirectional In the bidirectional mode (BKBID bit set to 1), the break input is configured both in input mode and in open drain output mode. Any active break event asserts a low logic level on the Break input to indicate an internal break event to external devices. Note: This bit cannot be modified as long as LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register). Note: Any write operation to this bit takes a delay of 1 APB clock cycle to become effective..
Allowed values:
0x0: B_0x0: Break input BRK in input mode
0x1: B_0x1: Break input BRK in bidirectional mode
DMA control register
Offset: 0x48, reset: 0x0000, access: read-write
2/2 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
DBL
rw |
DBA
rw |
||||||||||||||
Bits 0-4: DMA base address This 5-bit field defines the base-address for DMA transfers (when read/write access are done through the TIMx_DMAR address). DBA is defined as an offset starting from the address of the TIMx_CR1 register. Example: ....
Allowed values:
0x0: B_0x0: TIMx_CR1,
0x1: B_0x1: TIMx_CR2,
0x2: B_0x2: TIMx_SMCR,
Bits 8-12: DMA burst length This 5-bit field defines the length of DMA transfers (the timer recognizes a burst transfer when a read or a write access is done to the TIMx_DMAR address). ....
Allowed values:
0x0: B_0x0: 1 transfer,
0x1: B_0x1: 2 transfers,
0x2: B_0x2: 3 transfers,
0x11: B_0x11: 18 transfers.
DMA address for full transfer
Offset: 0x4C, reset: 0x0000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
DMAB
rw |
|||||||||||||||
TIM15 alternate register 1
Offset: 0x60, reset: 0x00000001, access: read-write
6/6 fields covered.
Bit 0: BRK BKIN input enable This bit enables the BKIN alternate function input for the timerâs BRK input. BKIN input is 'ORedâ with the other BRK sources. Note: This bit can not be modified as long as LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: BKIN input disabled
0x1: B_0x1: BKIN input enabled
Bit 1: BRK COMP1 enable This bit enables the COMP1 for the timerâs BRK input. COMP1 output is 'ORedâ with the other BRK sources. Note: This bit can not be modified as long as LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: COMP1 input disabled
0x1: B_0x1: COMP1 input enabled
Bit 2: BRK COMP2 enable This bit enables the COMP2 for the timerâs BRK input. COMP2 output is 'ORedâ with the other BRK sources. Note: This bit can not be modified as long as LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: COMP2 input disabled
0x1: B_0x1: COMP2 input enabled
Bit 9: BRK BKIN input polarity This bit selects the BKIN alternate function input sensitivity. It must be programmed together with the BKP polarity bit. Note: This bit can not be modified as long as LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: BKIN input is active low
0x1: B_0x1: BKIN input is active high
Bit 10: BRK COMP1 input polarity This bit selects the COMP1 input sensitivity. It must be programmed together with the BKP polarity bit. Note: This bit can not be modified as long as LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: COMP1 input is active low
0x1: B_0x1: COMP1 input is active high
Bit 11: BRK COMP2 input polarity This bit selects the COMP2 input sensitivity. It must be programmed together with the BKP polarity bit. Note: This bit can not be modified as long as LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: COMP2 input is active low
0x1: B_0x1: COMP2 input is active high
input selection register
Offset: 0x68, reset: 0x0000, access: read-write
2/2 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
TI2SEL
rw |
TI1SEL
rw |
||||||||||||||
0x40014400: General purpose timers
58/66 fields covered. Toggle Registers
| Offset | Name | 31 |
30 |
29 |
28 |
27 |
26 |
25 |
24 |
23 |
22 |
21 |
20 |
19 |
18 |
17 |
16 |
15 |
14 |
13 |
12 |
11 |
10 |
9 |
8 |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x0 | CR1 | ||||||||||||||||||||||||||||||||
| 0x4 | CR2 | ||||||||||||||||||||||||||||||||
| 0xC | DIER | ||||||||||||||||||||||||||||||||
| 0x10 | SR | ||||||||||||||||||||||||||||||||
| 0x14 | EGR | ||||||||||||||||||||||||||||||||
| 0x18 | CCMR1_Input | ||||||||||||||||||||||||||||||||
| 0x18 | CCMR1_Output | ||||||||||||||||||||||||||||||||
| 0x20 | CCER | ||||||||||||||||||||||||||||||||
| 0x24 | CNT | ||||||||||||||||||||||||||||||||
| 0x28 | PSC | ||||||||||||||||||||||||||||||||
| 0x2C | ARR | ||||||||||||||||||||||||||||||||
| 0x30 | RCR | ||||||||||||||||||||||||||||||||
| 0x34 | CCR1 | ||||||||||||||||||||||||||||||||
| 0x44 | BDTR | ||||||||||||||||||||||||||||||||
| 0x48 | DCR | ||||||||||||||||||||||||||||||||
| 0x4C | DMAR | ||||||||||||||||||||||||||||||||
| 0x60 | AF1 | ||||||||||||||||||||||||||||||||
| 0x68 | TISEL | ||||||||||||||||||||||||||||||||
control register 1
Offset: 0x0, reset: 0x0000, access: read-write
7/7 fields covered.
Bit 1: Update disable This bit is set and cleared by software to enable/disable UEV event generation. Counter overflow/underflow Setting the UG bit Update generation through the slave mode controller Buffered registers are then loaded with their preload values..
Allowed values:
0x0: B_0x0: UEV enabled. The Update (UEV) event is generated by one of the following events:
0x1: B_0x1: UEV disabled. The Update event is not generated, shadow registers keep their value (ARR, PSC, CCRx). However the counter and the prescaler are reinitialized if the UG bit is set or if a hardware reset is received from the slave mode controller.
Bit 2: Update request source This bit is set and cleared by software to select the UEV event sources. Counter overflow/underflow Setting the UG bit Update generation through the slave mode controller.
Allowed values:
0x0: B_0x0: Any of the following events generate an update interrupt or DMA request if enabled. These events can be:
0x1: B_0x1: Only counter overflow/underflow generates an update interrupt or DMA request if enabled.
Bits 8-9: Clock division This bit-field indicates the division ratio between the timer clock (CK_INT) frequency and the dead-time and sampling clock (tDTS)used by the dead-time generators and the digital filters (TIx),.
Allowed values:
0x0: B_0x0: tDTS=tCK_INT
0x1: B_0x1: tDTS=2*tCK_INT
0x2: B_0x2: tDTS=4*tCK_INT
0x3: B_0x3: Reserved, do not program this value
control register 2
Offset: 0x4, reset: 0x0000, access: read-write
5/5 fields covered.
Bit 0: Capture/compare preloaded control Note: This bit acts only on channels that have a complementary output..
Allowed values:
0x0: B_0x0: CCxE, CCxNE and OCxM bits are not preloaded
0x1: B_0x1: CCxE, CCxNE and OCxM bits are preloaded, after having been written, they are updated only when COM bit is set.
Bit 2: Capture/compare control update selection Note: This bit acts only on channels that have a complementary output..
Allowed values:
0x0: B_0x0: When capture/compare control bits are preloaded (CCPC=1), they are updated by setting the COMG bit only.
0x1: B_0x1: When capture/compare control bits are preloaded (CCPC=1), they are updated by setting the COMG bit or when an rising edge occurs on TRGI.
Bit 8: Output Idle state 1 (OC1 output) Note: This bit can not be modified as long as LOCK level 1, 2 or 3 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: OC1=0 (after a dead-time if OC1N is implemented) when MOE=0
0x1: B_0x1: OC1=1 (after a dead-time if OC1N is implemented) when MOE=0
status register
Offset: 0x10, reset: 0x0000, access: read-write
5/5 fields covered.
Bit 0: Update interrupt flag This bit is set by hardware on an update event. It is cleared by software. At overflow regarding the repetition counter value (update if repetition counter = 0) and if the UDIS=0 in the TIMx_CR1 register. When CNT is reinitialized by software using the UG bit in TIMx_EGR register, if URS=0 and UDIS=0 in the TIMx_CR1 register..
Allowed values:
0x0: B_0x0: No update occurred.
0x1: B_0x1: Update interrupt pending. This bit is set by hardware when the registers are updated:
Bit 1: Capture/Compare 1 interrupt flag This flag is set by hardware. It is cleared by software (input capture or output compare mode) or by reading the TIMx_CCR1 register (input capture mode only). If channel CC1 is configured as output: this flag is set when the content of the counter TIMx_CNT matches the content of the TIMx_CCR1 register. When the content of TIMx_CCR1 is greater than the content of TIMx_ARR, the CC1IF bit goes high on the counter overflow (in up-counting and up/down-counting modes) or underflow (in down-counting mode). There are 3 possible options for flag setting in center-aligned mode, refer to the CMS bits in the TIMx_CR1 register for the full description. If channel CC1 is configured as input: this bit is set when counter value has been captured in TIMx_CCR1 register (an edge has been detected on IC1, as per the edge sensitivity defined with the CC1P and CC1NP bits setting, in TIMx_CCER)..
Allowed values:
0x0: B_0x0: No compare match / No input capture occurred
0x1: B_0x1: A compare match or an input capture occurred
Bit 9: Capture/Compare 1 overcapture flag This flag is set by hardware only when the corresponding channel is configured in input capture mode. It is cleared by software by writing it to '0â..
Allowed values:
0x0: B_0x0: No overcapture has been detected
0x1: B_0x1: The counter value has been captured in TIMx_CCR1 register while CC1IF flag was already set
event generation register
Offset: 0x14, reset: 0x0000, access: write-only
4/4 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
BG
w |
COMG
w |
CC1G
w |
UG
w |
||||||||||||
Bit 0: Update generation This bit can be set by software, it is automatically cleared by hardware..
Allowed values:
0x0: B_0x0: No action.
0x1: B_0x1: Reinitialize the counter and generates an update of the registers. Note that the prescaler counter is cleared too (anyway the prescaler ratio is not affected).
Bit 1: Capture/Compare 1 generation This bit is set by software in order to generate an event, it is automatically cleared by hardware. If channel CC1 is configured as output: CC1IF flag is set, Corresponding interrupt or DMA request is sent if enabled. If channel CC1 is configured as input: The current value of the counter is captured in TIMx_CCR1 register. The CC1IF flag is set, the corresponding interrupt or DMA request is sent if enabled. The CC1OF flag is set if the CC1IF flag was already high..
Allowed values:
0x0: B_0x0: No action.
0x1: B_0x1: A capture/compare event is generated on channel 1:
Bit 5: Capture/Compare control update generation This bit can be set by software, it is automatically cleared by hardware. Note: This bit acts only on channels that have a complementary output..
Allowed values:
0x0: B_0x0: No action
0x1: B_0x1: When the CCPC bit is set, it is possible to update the CCxE, CCxNE and OCxM bits
Bit 7: Break generation This bit is set by software in order to generate an event, it is automatically cleared by hardware..
Allowed values:
0x0: B_0x0: No action.
0x1: B_0x1: A break event is generated. MOE bit is cleared and BIF flag is set. Related interrupt or DMA transfer can occur if enabled.
capture/compare mode register 1 (input mode)
Offset: 0x18, reset: 0x00000000, access: read-write
3/3 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
IC1F
rw |
IC1PSC
rw |
CC1S
rw |
|||||||||||||
Bits 0-1: Capture/Compare 1 Selection This bit-field defines the direction of the channel (input/output) as well as the used input. Others: Reserved Note: CC1S bits are writable only when the channel is OFF (CC1E = '0â in TIMx_CCER)..
Allowed values:
0x0: B_0x0: CC1 channel is configured as output
0x1: B_0x1: CC1 channel is configured as input, IC1 is mapped on TI1
Bits 2-3: Input capture 1 prescaler This bit-field defines the ratio of the prescaler acting on CC1 input (IC1). The prescaler is reset as soon as CC1E=â0â (TIMx_CCER register)..
Allowed values:
0x0: B_0x0: no prescaler, capture is done each time an edge is detected on the capture input.
0x1: B_0x1: capture is done once every 2 events
0x2: B_0x2: capture is done once every 4 events
0x3: B_0x3: capture is done once every 8 events
Bits 4-7: Input capture 1 filter This bit-field defines the frequency used to sample TI1 input and the length of the digital filter applied to TI1. The digital filter is made of an event counter in which N consecutive events are needed to validate a transition on the output:.
Allowed values:
0x0: B_0x0: No filter, sampling is done at fDTS
0x1: B_0x1: fSAMPLING=fCK_INT, N=2
0x2: B_0x2: fSAMPLING=fCK_INT, N=4
0x3: B_0x3: fSAMPLING=fCK_INT, N=8
0x4: B_0x4: fSAMPLING=fDTS/2, N=
0x5: B_0x5: fSAMPLING=fDTS/2, N=8
0x6: B_0x6: fSAMPLING=fDTS/4, N=6
0x7: B_0x7: fSAMPLING=fDTS/4, N=8
0x8: B_0x8: fSAMPLING=fDTS/8, N=6
0x9: B_0x9: fSAMPLING=fDTS/8, N=8
0xA: B_0xA: fSAMPLING=fDTS/16, N=5
0xB: B_0xB: fSAMPLING=fDTS/16, N=6
0xC: B_0xC: fSAMPLING=fDTS/16, N=8
0xD: B_0xD: fSAMPLING=fDTS/32, N=5
0xE: B_0xE: fSAMPLING=fDTS/32, N=6
0xF: B_0xF: fSAMPLING=fDTS/32, N=8
capture/compare mode register (output mode)
Offset: 0x18, reset: 0x00000000, access: read-write
4/5 fields covered.
Bits 0-1: Capture/Compare 1 selection This bit-field defines the direction of the channel (input/output) as well as the used input. Others: Reserved Note: CC1S bits are writable only when the channel is OFF (CC1E = '0â in TIMx_CCER)..
Allowed values:
0x0: B_0x0: CC1 channel is configured as output
0x1: B_0x1: CC1 channel is configured as input, IC1 is mapped on TI1
Bit 2: Output Compare 1 fast enable This bit decreases the latency between a trigger event and a transition on the timer output. It must be used in one-pulse mode (OPM bit set in TIMx_CR1 register), to have the output pulse starting as soon as possible after the starting trigger..
Allowed values:
0x0: B_0x0: CC1 behaves normally depending on counter and CCR1 values even when the trigger is ON. The minimum delay to activate CC1 output when an edge occurs on the trigger input is 5 clock cycles.
0x1: B_0x1: An active edge on the trigger input acts like a compare match on CC1 output. Then, OC is set to the compare level independently of the result of the comparison. Delay to sample the trigger input and to activate CC1 output is reduced to 3 clock cycles. OC1FE acts only if the channel is configured in PWM1 or PWM2 mode.
Bit 3: Output Compare 1 preload enable Note: These bits can not be modified as long as LOCK level 3 has been programmed (LOCK bits in TIMx_BDTR register) and CC1S=â00â (the channel is configured in output). The PWM mode can be used without validating the preload register only in one pulse mode (OPM bit set in TIMx_CR1 register). Else the behavior is not guaranteed..
Allowed values:
0x0: B_0x0: Preload register on TIMx_CCR1 disabled. TIMx_CCR1 can be written at anytime, the new value is taken in account immediately.
0x1: B_0x1: Preload register on TIMx_CCR1 enabled. Read/Write operations access the preload register. TIMx_CCR1 preload value is loaded in the active register at each update event.
Bits 4-6: Output Compare 1 mode These bits define the behavior of the output reference signal OC1REF from which OC1 and OC1N are derived. OC1REF is active high whereas OC1 and OC1N active level depends on CC1P and CC1NP bits. All other values: Reserved Note: These bits can not be modified as long as LOCK level 3 has been programmed (LOCK bits in TIMx_BDTR register) and CC1S=â00â (the channel is configured in output). In PWM mode 1 or 2, the OCREF level changes only when the result of the comparison changes or when the output compare mode switches from âfrozenâ mode to âPWMâ mode. The OC1M[3] bit is not contiguous, located in bit 16..
Allowed values:
0: Frozen: The comparison between the output compare register TIMx_CCRy and the counter TIMx_CNT has no effect on the outputs
1: ActiveOnMatch: Set channel to active level on match. OCyREF signal is forced high when the counter matches the capture/compare register
2: InactiveOnMatch: Set channel to inactive level on match. OCyREF signal is forced low when the counter matches the capture/compare register
3: Toggle: OCyREF toggles when TIMx_CNT=TIMx_CCRy
4: ForceInactive: OCyREF is forced low
5: ForceActive: OCyREF is forced high
6: PwmMode1: In upcounting, channel is active as long as TIMx_CNT
7: PwmMode2: Inversely to PwmMode1
Bit 16: Output Compare 1 mode These bits define the behavior of the output reference signal OC1REF from which OC1 and OC1N are derived. OC1REF is active high whereas OC1 and OC1N active level depends on CC1P and CC1NP bits. All other values: Reserved Note: These bits can not be modified as long as LOCK level 3 has been programmed (LOCK bits in TIMx_BDTR register) and CC1S=â00â (the channel is configured in output). In PWM mode 1 or 2, the OCREF level changes only when the result of the comparison changes or when the output compare mode switches from âfrozenâ mode to âPWMâ mode. The OC1M[3] bit is not contiguous, located in bit 16..
capture/compare enable register
Offset: 0x20, reset: 0x0000, access: read-write
4/4 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
CC1NP
rw |
CC1NE
rw |
CC1P
rw |
CC1E
rw |
||||||||||||
Bit 0: Capture/Compare 1 output enable When CC1 channel is configured as output, the OC1 level depends on MOE, OSSI, OSSR, OIS1, OIS1N and CC1NE bits, regardless of the CC1E bits state. Refer to for details..
Allowed values:
0x0: B_0x0: Capture mode disabled / OC1 is not active (see below)
0x1: B_0x1: Capture mode enabled / OC1 signal is output on the corresponding output pin
Bit 1: Capture/Compare 1 output polarity When CC1 channel is configured as input, both CC1NP/CC1P bits select the active polarity of TI1FP1 and TI2FP1 for trigger or capture operations. CC1NP=0, CC1P=0: non-inverted/rising edge. The circuit is sensitive to TIxFP1 rising edge (capture or trigger operations in reset, external clock or trigger mode), TIxFP1 is not inverted (trigger operation in gated mode or encoder mode). CC1NP=0, CC1P=1: inverted/falling edge. The circuit is sensitive to TIxFP1 falling edge (capture or trigger operations in reset, external clock or trigger mode), TIxFP1 is inverted (trigger operation in gated mode or encoder mode). CC1NP=1, CC1P=1: non-inverted/both edges/ The circuit is sensitive to both TIxFP1 rising and falling edges (capture or trigger operations in reset, external clock or trigger mode), TIxFP1is not inverted (trigger operation in gated mode). This configuration must not be used in encoder mode. CC1NP=1, CC1P=0: this configuration is reserved, it must not be used. Note: This bit is not writable as soon as LOCK level 2 or 3 has been programmed (LOCK bits in TIMx_BDTR register). On channels that have a complementary output, this bit is preloaded. If the CCPC bit is set in the TIMx_CR2 register then the CC1P active bit takes the new value from the preloaded bit only when a Commutation event is generated..
Allowed values:
0x0: B_0x0: OC1 active high (output mode) / Edge sensitivity selection (input mode, see below)
0x1: B_0x1: OC1 active low (output mode) / Edge sensitivity selection (input mode, see below)
Bit 2: Capture/Compare 1 complementary output enable.
Allowed values:
0x0: B_0x0: Off - OC1N is not active. OC1N level is then function of MOE, OSSI, OSSR, OIS1, OIS1N and CC1E bits.
0x1: B_0x1: On - OC1N signal is output on the corresponding output pin depending on MOE, OSSI, OSSR, OIS1, OIS1N and CC1E bits.
Bit 3: Capture/Compare 1 complementary output polarity CC1 channel configured as output: CC1 channel configured as input: This bit is used in conjunction with CC1P to define the polarity of TI1FP1 and TI2FP1. Refer to the description of CC1P. Note: This bit is not writable as soon as LOCK level 2 or 3 has been programmed (LOCK bits in TIMx_BDTR register) and CC1S=â00â (the channel is configured in output). On channels that have a complementary output, this bit is preloaded. If the CCPC bit is set in the TIMx_CR2 register then the CC1NP active bit takes the new value from the preloaded bit only when a commutation event is generated..
Allowed values:
0x0: B_0x0: OC1N active high
0x1: B_0x1: OC1N active low
counter
Offset: 0x24, reset: 0x00000000, access: Unspecified
1/2 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
UIFCPY
r |
|||||||||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
CNT
rw |
|||||||||||||||
prescaler
Offset: 0x28, reset: 0x0000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
PSC
rw |
|||||||||||||||
auto-reload register
Offset: 0x2C, reset: 0x0000FFFF, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
ARR
rw |
|||||||||||||||
repetition counter register
Offset: 0x30, reset: 0x0000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
REP
rw |
|||||||||||||||
capture/compare register 1
Offset: 0x34, reset: 0x00000000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
CCR1
rw |
|||||||||||||||
break and dead-time register
Offset: 0x44, reset: 0x0000, access: read-write
10/11 fields covered.
Bits 0-7: Dead-time generator setup This bit-field defines the duration of the dead-time inserted between the complementary outputs. DT correspond to this duration. DTG[7:5]=0xx => DT=DTG[7:0]x tdtg with tdtg=tDTS DTG[7:5]=10x => DT=(64+DTG[5:0])xtdtg with Tdtg=2xtDTS DTG[7:5]=110 => DT=(32+DTG[4:0])xtdtg with Tdtg=8xtDTS DTG[7:5]=111 => DT=(32+DTG[4:0])xtdtg with Tdtg=16xtDTS Example if TDTS=125ns (8MHz), dead-time possible values are: 0 to 15875 ns by 125 ns steps, 16 µs to 31750 ns by 250 ns steps, 32 µs to 63 µs by 1 µs steps, 64 µs to 126 µs by 2 µs steps Note: This bit-field can not be modified as long as LOCK level 1, 2 or 3 has been programmed (LOCK bits in TIMx_BDTR register)..
Bits 8-9: Lock configuration These bits offer a write protection against software errors. Note: The LOCK bits can be written only once after the reset. Once the TIMx_BDTR register has been written, their content is frozen until the next reset..
Allowed values:
0x0: B_0x0: LOCK OFF - No bit is write protected
0x1: B_0x1: LOCK Level 1 = DTG bits in TIMx_BDTR register, OISx and OISxN bits in TIMx_CR2 register and BKE/BKP/AOE bits in TIMx_BDTR register can no longer be written.
0x2: B_0x2: LOCK Level 2 = LOCK Level 1 + CC Polarity bits (CCxP/CCxNP bits in TIMx_CCER register, as long as the related channel is configured in output through the CCxS bits) as well as OSSR and OSSI bits can no longer be written.
0x3: B_0x3: LOCK Level 3 = LOCK Level 2 + CC Control bits (OCxM and OCxPE bits in TIMx_CCMRx registers, as long as the related channel is configured in output through the CCxS bits) can no longer be written.
Bit 10: Off-state selection for Idle mode This bit is used when MOE=0 on channels configured as outputs. See OC/OCN enable description for more details (enable register (TIM16_CCER)(TIMx_CCER)(x = 16 to 17) on page 846). Note: This bit can not be modified as soon as the LOCK level 2 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: When inactive, OC/OCN outputs are disabled (OC/OCN enable output signal=0)
0x1: B_0x1: When inactive, OC/OCN outputs are forced first with their idle level as soon as CCxE=1 or CCxNE=1. OC/OCN enable output signal=1)
Bit 11: Off-state selection for Run mode This bit is used when MOE=1 on channels that have a complementary output which are configured as outputs. OSSR is not implemented if no complementary output is implemented in the timer. See OC/OCN enable description for more details (enable register (TIM16_CCER)(TIMx_CCER)(x = 16 to 17) on page 846). Note: This bit can not be modified as soon as the LOCK level 2 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: When inactive, OC/OCN outputs are disabled (the timer releases the output control which is taken over by the AFIO logic, which forces a Hi-Z state)
0x1: B_0x1: When inactive, OC/OCN outputs are enabled with their inactive level as soon as CCxE=1 or CCxNE=1 (the output is still controlled by the timer).
Bit 12: Break enable 1; Break inputs (BRK and CCS clock failure event) enabled Note: This bit cannot be modified when LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register). Any write operation to this bit takes a delay of 1 APB clock cycle to become effective..
Allowed values:
0x0: B_0x0: Break inputs (BRK and CCS clock failure event) disabled
Bit 13: Break polarity Note: This bit can not be modified as long as LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register). Any write operation to this bit takes a delay of 1 APB clock cycle to become effective..
Allowed values:
0x0: B_0x0: Break input BRK is active low
0x1: B_0x1: Break input BRK is active high
Bit 14: Automatic output enable Note: This bit can not be modified as long as LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: MOE can be set only by software
0x1: B_0x1: MOE can be set by software or automatically at the next update event (if the break input is not be active)
Bit 15: Main output enable This bit is cleared asynchronously by hardware as soon as the break input is active. It is set by software or automatically depending on the AOE bit. It is acting only on the channels which are configured in output. enable register (TIM16_CCER)(TIMx_CCER)(x = 16 to 17) on page 846)..
Allowed values:
0x0: B_0x0: OC and OCN outputs are disabled or forced to idle state depending on the OSSI bit.
0x1: B_0x1: OC and OCN outputs are enabled if their respective enable bits are set (CCxE, CCxNE in TIMx_CCER register)See OC/OCN enable description for more details (
Bits 16-19: Break filter This bit-field defines the frequency used to sample BRK input and the length of the digital filter applied to BRK. The digital filter is made of an event counter in which N events are needed to validate a transition on the output: This bit cannot be modified when LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: No filter, BRK acts asynchronously
0x1: B_0x1: fSAMPLING=fCK_INT, N=2
0x2: B_0x2: fSAMPLING=fCK_INT, N=4
0x3: B_0x3: fSAMPLING=fCK_INT, N=8
0x4: B_0x4: fSAMPLING=fDTS/2, N=6
0x5: B_0x5: fSAMPLING=fDTS/2, N=8
0x6: B_0x6: fSAMPLING=fDTS/4, N=6
0x7: B_0x7: fSAMPLING=fDTS/4, N=8
0x8: B_0x8: fSAMPLING=fDTS/8, N=6
0x9: B_0x9: fSAMPLING=fDTS/8, N=8
0xA: B_0xA: fSAMPLING=fDTS/16, N=5
0xB: B_0xB: fSAMPLING=fDTS/16, N=6
0xC: B_0xC: fSAMPLING=fDTS/16, N=8
0xD: B_0xD: fSAMPLING=fDTS/32, N=5
0xE: B_0xE: fSAMPLING=fDTS/32, N=6
0xF: B_0xF: fSAMPLING=fDTS/32, N=8
Bit 26: Break Disarm This bit is cleared by hardware when no break source is active. The BKDSRM bit must be set by software to release the bidirectional output control (open-drain output in Hi-Z state) and then be polled it until it is reset by hardware, indicating that the fault condition has disappeared. Note: Any write operation to this bit takes a delay of 1 APB clock cycle to become effective..
Allowed values:
0x0: B_0x0: Break input BRK is armed
0x1: B_0x1: Break input BRK is disarmed
Bit 28: Break Bidirectional In the bidirectional mode (BKBID bit set to 1), the break input is configured both in input mode and in open drain output mode. Any active break event asserts a low logic level on the Break input to indicate an internal break event to external devices. Note: This bit cannot be modified as long as LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register). Note: Any write operation to this bit takes a delay of 1 APB clock cycle to become effective..
Allowed values:
0x0: B_0x0: Break input BRK in input mode
0x1: B_0x1: Break input BRK in bidirectional mode
DMA control register
Offset: 0x48, reset: 0x0000, access: read-write
2/2 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
DBL
rw |
DBA
rw |
||||||||||||||
Bits 0-4: DMA base address This 5-bit field defines the base-address for DMA transfers (when read/write access are done through the TIMx_DMAR address). DBA is defined as an offset starting from the address of the TIMx_CR1 register. Example: ... Example: Let us consider the following transfer: DBL = 7 transfers and DBA = TIMx_CR1. In this case the transfer is done to/from 7 registers starting from the TIMx_CR1 address..
Allowed values:
0x0: B_0x0: TIMx_CR1,
0x1: B_0x1: TIMx_CR2,
0x2: B_0x2: TIMx_SMCR,
Bits 8-12: DMA burst length This 5-bit field defines the length of DMA transfers (the timer recognizes a burst transfer when a read or a write access is done to the TIMx_DMAR address), i.e. the number of transfers. Transfers can be in half-words or in bytes (see example below). ....
Allowed values:
0x0: B_0x0: 1 transfer,
0x1: B_0x1: 2 transfers,
0x2: B_0x2: 3 transfers,
0x11: B_0x11: 18 transfers.
DMA address for full transfer
Offset: 0x4C, reset: 0x0000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
DMAB
rw |
|||||||||||||||
TIM17 option register 1
Offset: 0x60, reset: 0x00000001, access: read-write
6/6 fields covered.
Bit 0: BRK BKIN input enable This bit enables the BKIN alternate function input for the timerâs BRK input. BKIN input is 'ORedâ with the other BRK sources. Note: This bit can not be modified as long as LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: BKIN input disabled
0x1: B_0x1: BKIN input enabled
Bit 1: BRK COMP1 enable This bit enables the COMP1 for the timerâs BRK input. COMP1 output is 'ORedâ with the other BRK sources. Note: This bit can not be modified as long as LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: COMP1 input disabled
0x1: B_0x1: COMP1 input enabled
Bit 2: BRK COMP2 enable This bit enables the COMP2 for the timerâs BRK input. COMP2 output is 'ORedâ with the other BRK sources. Note: This bit can not be modified as long as LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: COMP2 input disabled
0x1: B_0x1: COMP2 input enabled
Bit 9: BRK BKIN input polarity This bit selects the BKIN alternate function input sensitivity. It must be programmed together with the BKP polarity bit. Note: This bit can not be modified as long as LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: BKIN input is active low
0x1: B_0x1: BKIN input is active high
Bit 10: BRK COMP1 input polarity This bit selects the COMP1 input sensitivity. It must be programmed together with the BKP polarity bit. Note: This bit can not be modified as long as LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: COMP1 input is active low
0x1: B_0x1: COMP1 input is active high
Bit 11: BRK COMP2 input polarity This bit selects the COMP2 input sensitivity. It must be programmed together with the BKP polarity bit. Note: This bit can not be modified as long as LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: COMP2 input is active low
0x1: B_0x1: COMP2 input is active high
input selection register
Offset: 0x68, reset: 0x0000, access: read-write
1/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
TI1SEL
rw |
|||||||||||||||
0x40014800: General purpose timers
58/66 fields covered. Toggle Registers
| Offset | Name | 31 |
30 |
29 |
28 |
27 |
26 |
25 |
24 |
23 |
22 |
21 |
20 |
19 |
18 |
17 |
16 |
15 |
14 |
13 |
12 |
11 |
10 |
9 |
8 |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x0 | CR1 | ||||||||||||||||||||||||||||||||
| 0x4 | CR2 | ||||||||||||||||||||||||||||||||
| 0xC | DIER | ||||||||||||||||||||||||||||||||
| 0x10 | SR | ||||||||||||||||||||||||||||||||
| 0x14 | EGR | ||||||||||||||||||||||||||||||||
| 0x18 | CCMR1_Input | ||||||||||||||||||||||||||||||||
| 0x18 | CCMR1_Output | ||||||||||||||||||||||||||||||||
| 0x20 | CCER | ||||||||||||||||||||||||||||||||
| 0x24 | CNT | ||||||||||||||||||||||||||||||||
| 0x28 | PSC | ||||||||||||||||||||||||||||||||
| 0x2C | ARR | ||||||||||||||||||||||||||||||||
| 0x30 | RCR | ||||||||||||||||||||||||||||||||
| 0x34 | CCR1 | ||||||||||||||||||||||||||||||||
| 0x44 | BDTR | ||||||||||||||||||||||||||||||||
| 0x48 | DCR | ||||||||||||||||||||||||||||||||
| 0x4C | DMAR | ||||||||||||||||||||||||||||||||
| 0x60 | AF1 | ||||||||||||||||||||||||||||||||
| 0x68 | TISEL | ||||||||||||||||||||||||||||||||
control register 1
Offset: 0x0, reset: 0x0000, access: read-write
7/7 fields covered.
Bit 1: Update disable This bit is set and cleared by software to enable/disable UEV event generation. Counter overflow/underflow Setting the UG bit Update generation through the slave mode controller Buffered registers are then loaded with their preload values..
Allowed values:
0x0: B_0x0: UEV enabled. The Update (UEV) event is generated by one of the following events:
0x1: B_0x1: UEV disabled. The Update event is not generated, shadow registers keep their value (ARR, PSC, CCRx). However the counter and the prescaler are reinitialized if the UG bit is set or if a hardware reset is received from the slave mode controller.
Bit 2: Update request source This bit is set and cleared by software to select the UEV event sources. Counter overflow/underflow Setting the UG bit Update generation through the slave mode controller.
Allowed values:
0x0: B_0x0: Any of the following events generate an update interrupt or DMA request if enabled. These events can be:
0x1: B_0x1: Only counter overflow/underflow generates an update interrupt or DMA request if enabled.
Bits 8-9: Clock division This bit-field indicates the division ratio between the timer clock (CK_INT) frequency and the dead-time and sampling clock (tDTS)used by the dead-time generators and the digital filters (TIx),.
Allowed values:
0x0: B_0x0: tDTS=tCK_INT
0x1: B_0x1: tDTS=2*tCK_INT
0x2: B_0x2: tDTS=4*tCK_INT
0x3: B_0x3: Reserved, do not program this value
control register 2
Offset: 0x4, reset: 0x0000, access: read-write
5/5 fields covered.
Bit 0: Capture/compare preloaded control Note: This bit acts only on channels that have a complementary output..
Allowed values:
0x0: B_0x0: CCxE, CCxNE and OCxM bits are not preloaded
0x1: B_0x1: CCxE, CCxNE and OCxM bits are preloaded, after having been written, they are updated only when COM bit is set.
Bit 2: Capture/compare control update selection Note: This bit acts only on channels that have a complementary output..
Allowed values:
0x0: B_0x0: When capture/compare control bits are preloaded (CCPC=1), they are updated by setting the COMG bit only.
0x1: B_0x1: When capture/compare control bits are preloaded (CCPC=1), they are updated by setting the COMG bit or when an rising edge occurs on TRGI.
Bit 8: Output Idle state 1 (OC1 output) Note: This bit can not be modified as long as LOCK level 1, 2 or 3 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: OC1=0 (after a dead-time if OC1N is implemented) when MOE=0
0x1: B_0x1: OC1=1 (after a dead-time if OC1N is implemented) when MOE=0
status register
Offset: 0x10, reset: 0x0000, access: read-write
5/5 fields covered.
Bit 0: Update interrupt flag This bit is set by hardware on an update event. It is cleared by software. At overflow regarding the repetition counter value (update if repetition counter = 0) and if the UDIS=0 in the TIMx_CR1 register. When CNT is reinitialized by software using the UG bit in TIMx_EGR register, if URS=0 and UDIS=0 in the TIMx_CR1 register..
Allowed values:
0x0: B_0x0: No update occurred.
0x1: B_0x1: Update interrupt pending. This bit is set by hardware when the registers are updated:
Bit 1: Capture/Compare 1 interrupt flag This flag is set by hardware. It is cleared by software (input capture or output compare mode) or by reading the TIMx_CCR1 register (input capture mode only). If channel CC1 is configured as output: this flag is set when the content of the counter TIMx_CNT matches the content of the TIMx_CCR1 register. When the content of TIMx_CCR1 is greater than the content of TIMx_ARR, the CC1IF bit goes high on the counter overflow (in up-counting and up/down-counting modes) or underflow (in down-counting mode). There are 3 possible options for flag setting in center-aligned mode, refer to the CMS bits in the TIMx_CR1 register for the full description. If channel CC1 is configured as input: this bit is set when counter value has been captured in TIMx_CCR1 register (an edge has been detected on IC1, as per the edge sensitivity defined with the CC1P and CC1NP bits setting, in TIMx_CCER)..
Allowed values:
0x0: B_0x0: No compare match / No input capture occurred
0x1: B_0x1: A compare match or an input capture occurred
Bit 9: Capture/Compare 1 overcapture flag This flag is set by hardware only when the corresponding channel is configured in input capture mode. It is cleared by software by writing it to '0â..
Allowed values:
0x0: B_0x0: No overcapture has been detected
0x1: B_0x1: The counter value has been captured in TIMx_CCR1 register while CC1IF flag was already set
event generation register
Offset: 0x14, reset: 0x0000, access: write-only
4/4 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
BG
w |
COMG
w |
CC1G
w |
UG
w |
||||||||||||
Bit 0: Update generation This bit can be set by software, it is automatically cleared by hardware..
Allowed values:
0x0: B_0x0: No action.
0x1: B_0x1: Reinitialize the counter and generates an update of the registers. Note that the prescaler counter is cleared too (anyway the prescaler ratio is not affected).
Bit 1: Capture/Compare 1 generation This bit is set by software in order to generate an event, it is automatically cleared by hardware. If channel CC1 is configured as output: CC1IF flag is set, Corresponding interrupt or DMA request is sent if enabled. If channel CC1 is configured as input: The current value of the counter is captured in TIMx_CCR1 register. The CC1IF flag is set, the corresponding interrupt or DMA request is sent if enabled. The CC1OF flag is set if the CC1IF flag was already high..
Allowed values:
0x0: B_0x0: No action.
0x1: B_0x1: A capture/compare event is generated on channel 1:
Bit 5: Capture/Compare control update generation This bit can be set by software, it is automatically cleared by hardware. Note: This bit acts only on channels that have a complementary output..
Allowed values:
0x0: B_0x0: No action
0x1: B_0x1: When the CCPC bit is set, it is possible to update the CCxE, CCxNE and OCxM bits
Bit 7: Break generation This bit is set by software in order to generate an event, it is automatically cleared by hardware..
Allowed values:
0x0: B_0x0: No action.
0x1: B_0x1: A break event is generated. MOE bit is cleared and BIF flag is set. Related interrupt or DMA transfer can occur if enabled.
capture/compare mode register 1 (input mode)
Offset: 0x18, reset: 0x00000000, access: read-write
3/3 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
IC1F
rw |
IC1PSC
rw |
CC1S
rw |
|||||||||||||
Bits 0-1: Capture/Compare 1 Selection This bit-field defines the direction of the channel (input/output) as well as the used input. Others: Reserved Note: CC1S bits are writable only when the channel is OFF (CC1E = '0â in TIMx_CCER)..
Allowed values:
0x0: B_0x0: CC1 channel is configured as output
0x1: B_0x1: CC1 channel is configured as input, IC1 is mapped on TI1
Bits 2-3: Input capture 1 prescaler This bit-field defines the ratio of the prescaler acting on CC1 input (IC1). The prescaler is reset as soon as CC1E=â0â (TIMx_CCER register)..
Allowed values:
0x0: B_0x0: no prescaler, capture is done each time an edge is detected on the capture input.
0x1: B_0x1: capture is done once every 2 events
0x2: B_0x2: capture is done once every 4 events
0x3: B_0x3: capture is done once every 8 events
Bits 4-7: Input capture 1 filter This bit-field defines the frequency used to sample TI1 input and the length of the digital filter applied to TI1. The digital filter is made of an event counter in which N consecutive events are needed to validate a transition on the output:.
Allowed values:
0x0: B_0x0: No filter, sampling is done at fDTS
0x1: B_0x1: fSAMPLING=fCK_INT, N=2
0x2: B_0x2: fSAMPLING=fCK_INT, N=4
0x3: B_0x3: fSAMPLING=fCK_INT, N=8
0x4: B_0x4: fSAMPLING=fDTS/2, N=
0x5: B_0x5: fSAMPLING=fDTS/2, N=8
0x6: B_0x6: fSAMPLING=fDTS/4, N=6
0x7: B_0x7: fSAMPLING=fDTS/4, N=8
0x8: B_0x8: fSAMPLING=fDTS/8, N=6
0x9: B_0x9: fSAMPLING=fDTS/8, N=8
0xA: B_0xA: fSAMPLING=fDTS/16, N=5
0xB: B_0xB: fSAMPLING=fDTS/16, N=6
0xC: B_0xC: fSAMPLING=fDTS/16, N=8
0xD: B_0xD: fSAMPLING=fDTS/32, N=5
0xE: B_0xE: fSAMPLING=fDTS/32, N=6
0xF: B_0xF: fSAMPLING=fDTS/32, N=8
capture/compare mode register (output mode)
Offset: 0x18, reset: 0x00000000, access: read-write
4/5 fields covered.
Bits 0-1: Capture/Compare 1 selection This bit-field defines the direction of the channel (input/output) as well as the used input. Others: Reserved Note: CC1S bits are writable only when the channel is OFF (CC1E = '0â in TIMx_CCER)..
Allowed values:
0x0: B_0x0: CC1 channel is configured as output
0x1: B_0x1: CC1 channel is configured as input, IC1 is mapped on TI1
Bit 2: Output Compare 1 fast enable This bit decreases the latency between a trigger event and a transition on the timer output. It must be used in one-pulse mode (OPM bit set in TIMx_CR1 register), to have the output pulse starting as soon as possible after the starting trigger..
Allowed values:
0x0: B_0x0: CC1 behaves normally depending on counter and CCR1 values even when the trigger is ON. The minimum delay to activate CC1 output when an edge occurs on the trigger input is 5 clock cycles.
0x1: B_0x1: An active edge on the trigger input acts like a compare match on CC1 output. Then, OC is set to the compare level independently of the result of the comparison. Delay to sample the trigger input and to activate CC1 output is reduced to 3 clock cycles. OC1FE acts only if the channel is configured in PWM1 or PWM2 mode.
Bit 3: Output Compare 1 preload enable Note: These bits can not be modified as long as LOCK level 3 has been programmed (LOCK bits in TIMx_BDTR register) and CC1S=â00â (the channel is configured in output). The PWM mode can be used without validating the preload register only in one pulse mode (OPM bit set in TIMx_CR1 register). Else the behavior is not guaranteed..
Allowed values:
0x0: B_0x0: Preload register on TIMx_CCR1 disabled. TIMx_CCR1 can be written at anytime, the new value is taken in account immediately.
0x1: B_0x1: Preload register on TIMx_CCR1 enabled. Read/Write operations access the preload register. TIMx_CCR1 preload value is loaded in the active register at each update event.
Bits 4-6: Output Compare 1 mode These bits define the behavior of the output reference signal OC1REF from which OC1 and OC1N are derived. OC1REF is active high whereas OC1 and OC1N active level depends on CC1P and CC1NP bits. All other values: Reserved Note: These bits can not be modified as long as LOCK level 3 has been programmed (LOCK bits in TIMx_BDTR register) and CC1S=â00â (the channel is configured in output). In PWM mode 1 or 2, the OCREF level changes only when the result of the comparison changes or when the output compare mode switches from âfrozenâ mode to âPWMâ mode. The OC1M[3] bit is not contiguous, located in bit 16..
Allowed values:
0: Frozen: The comparison between the output compare register TIMx_CCRy and the counter TIMx_CNT has no effect on the outputs
1: ActiveOnMatch: Set channel to active level on match. OCyREF signal is forced high when the counter matches the capture/compare register
2: InactiveOnMatch: Set channel to inactive level on match. OCyREF signal is forced low when the counter matches the capture/compare register
3: Toggle: OCyREF toggles when TIMx_CNT=TIMx_CCRy
4: ForceInactive: OCyREF is forced low
5: ForceActive: OCyREF is forced high
6: PwmMode1: In upcounting, channel is active as long as TIMx_CNT
7: PwmMode2: Inversely to PwmMode1
Bit 16: Output Compare 1 mode These bits define the behavior of the output reference signal OC1REF from which OC1 and OC1N are derived. OC1REF is active high whereas OC1 and OC1N active level depends on CC1P and CC1NP bits. All other values: Reserved Note: These bits can not be modified as long as LOCK level 3 has been programmed (LOCK bits in TIMx_BDTR register) and CC1S=â00â (the channel is configured in output). In PWM mode 1 or 2, the OCREF level changes only when the result of the comparison changes or when the output compare mode switches from âfrozenâ mode to âPWMâ mode. The OC1M[3] bit is not contiguous, located in bit 16..
capture/compare enable register
Offset: 0x20, reset: 0x0000, access: read-write
4/4 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
CC1NP
rw |
CC1NE
rw |
CC1P
rw |
CC1E
rw |
||||||||||||
Bit 0: Capture/Compare 1 output enable When CC1 channel is configured as output, the OC1 level depends on MOE, OSSI, OSSR, OIS1, OIS1N and CC1NE bits, regardless of the CC1E bits state. Refer to for details..
Allowed values:
0x0: B_0x0: Capture mode disabled / OC1 is not active (see below)
0x1: B_0x1: Capture mode enabled / OC1 signal is output on the corresponding output pin
Bit 1: Capture/Compare 1 output polarity When CC1 channel is configured as input, both CC1NP/CC1P bits select the active polarity of TI1FP1 and TI2FP1 for trigger or capture operations. CC1NP=0, CC1P=0: non-inverted/rising edge. The circuit is sensitive to TIxFP1 rising edge (capture or trigger operations in reset, external clock or trigger mode), TIxFP1 is not inverted (trigger operation in gated mode or encoder mode). CC1NP=0, CC1P=1: inverted/falling edge. The circuit is sensitive to TIxFP1 falling edge (capture or trigger operations in reset, external clock or trigger mode), TIxFP1 is inverted (trigger operation in gated mode or encoder mode). CC1NP=1, CC1P=1: non-inverted/both edges/ The circuit is sensitive to both TIxFP1 rising and falling edges (capture or trigger operations in reset, external clock or trigger mode), TIxFP1is not inverted (trigger operation in gated mode). This configuration must not be used in encoder mode. CC1NP=1, CC1P=0: this configuration is reserved, it must not be used. Note: This bit is not writable as soon as LOCK level 2 or 3 has been programmed (LOCK bits in TIMx_BDTR register). On channels that have a complementary output, this bit is preloaded. If the CCPC bit is set in the TIMx_CR2 register then the CC1P active bit takes the new value from the preloaded bit only when a Commutation event is generated..
Allowed values:
0x0: B_0x0: OC1 active high (output mode) / Edge sensitivity selection (input mode, see below)
0x1: B_0x1: OC1 active low (output mode) / Edge sensitivity selection (input mode, see below)
Bit 2: Capture/Compare 1 complementary output enable.
Allowed values:
0x0: B_0x0: Off - OC1N is not active. OC1N level is then function of MOE, OSSI, OSSR, OIS1, OIS1N and CC1E bits.
0x1: B_0x1: On - OC1N signal is output on the corresponding output pin depending on MOE, OSSI, OSSR, OIS1, OIS1N and CC1E bits.
Bit 3: Capture/Compare 1 complementary output polarity CC1 channel configured as output: CC1 channel configured as input: This bit is used in conjunction with CC1P to define the polarity of TI1FP1 and TI2FP1. Refer to the description of CC1P. Note: This bit is not writable as soon as LOCK level 2 or 3 has been programmed (LOCK bits in TIMx_BDTR register) and CC1S=â00â (the channel is configured in output). On channels that have a complementary output, this bit is preloaded. If the CCPC bit is set in the TIMx_CR2 register then the CC1NP active bit takes the new value from the preloaded bit only when a commutation event is generated..
Allowed values:
0x0: B_0x0: OC1N active high
0x1: B_0x1: OC1N active low
counter
Offset: 0x24, reset: 0x00000000, access: Unspecified
1/2 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
UIFCPY
r |
|||||||||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
CNT
rw |
|||||||||||||||
prescaler
Offset: 0x28, reset: 0x0000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
PSC
rw |
|||||||||||||||
auto-reload register
Offset: 0x2C, reset: 0x0000FFFF, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
ARR
rw |
|||||||||||||||
repetition counter register
Offset: 0x30, reset: 0x0000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
REP
rw |
|||||||||||||||
capture/compare register 1
Offset: 0x34, reset: 0x00000000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
CCR1
rw |
|||||||||||||||
break and dead-time register
Offset: 0x44, reset: 0x0000, access: read-write
10/11 fields covered.
Bits 0-7: Dead-time generator setup This bit-field defines the duration of the dead-time inserted between the complementary outputs. DT correspond to this duration. DTG[7:5]=0xx => DT=DTG[7:0]x tdtg with tdtg=tDTS DTG[7:5]=10x => DT=(64+DTG[5:0])xtdtg with Tdtg=2xtDTS DTG[7:5]=110 => DT=(32+DTG[4:0])xtdtg with Tdtg=8xtDTS DTG[7:5]=111 => DT=(32+DTG[4:0])xtdtg with Tdtg=16xtDTS Example if TDTS=125ns (8MHz), dead-time possible values are: 0 to 15875 ns by 125 ns steps, 16 µs to 31750 ns by 250 ns steps, 32 µs to 63 µs by 1 µs steps, 64 µs to 126 µs by 2 µs steps Note: This bit-field can not be modified as long as LOCK level 1, 2 or 3 has been programmed (LOCK bits in TIMx_BDTR register)..
Bits 8-9: Lock configuration These bits offer a write protection against software errors. Note: The LOCK bits can be written only once after the reset. Once the TIMx_BDTR register has been written, their content is frozen until the next reset..
Allowed values:
0x0: B_0x0: LOCK OFF - No bit is write protected
0x1: B_0x1: LOCK Level 1 = DTG bits in TIMx_BDTR register, OISx and OISxN bits in TIMx_CR2 register and BKE/BKP/AOE bits in TIMx_BDTR register can no longer be written.
0x2: B_0x2: LOCK Level 2 = LOCK Level 1 + CC Polarity bits (CCxP/CCxNP bits in TIMx_CCER register, as long as the related channel is configured in output through the CCxS bits) as well as OSSR and OSSI bits can no longer be written.
0x3: B_0x3: LOCK Level 3 = LOCK Level 2 + CC Control bits (OCxM and OCxPE bits in TIMx_CCMRx registers, as long as the related channel is configured in output through the CCxS bits) can no longer be written.
Bit 10: Off-state selection for Idle mode This bit is used when MOE=0 on channels configured as outputs. See OC/OCN enable description for more details (enable register (TIM16_CCER)(TIMx_CCER)(x = 16 to 17) on page 846). Note: This bit can not be modified as soon as the LOCK level 2 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: When inactive, OC/OCN outputs are disabled (OC/OCN enable output signal=0)
0x1: B_0x1: When inactive, OC/OCN outputs are forced first with their idle level as soon as CCxE=1 or CCxNE=1. OC/OCN enable output signal=1)
Bit 11: Off-state selection for Run mode This bit is used when MOE=1 on channels that have a complementary output which are configured as outputs. OSSR is not implemented if no complementary output is implemented in the timer. See OC/OCN enable description for more details (enable register (TIM16_CCER)(TIMx_CCER)(x = 16 to 17) on page 846). Note: This bit can not be modified as soon as the LOCK level 2 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: When inactive, OC/OCN outputs are disabled (the timer releases the output control which is taken over by the AFIO logic, which forces a Hi-Z state)
0x1: B_0x1: When inactive, OC/OCN outputs are enabled with their inactive level as soon as CCxE=1 or CCxNE=1 (the output is still controlled by the timer).
Bit 12: Break enable 1; Break inputs (BRK and CCS clock failure event) enabled Note: This bit cannot be modified when LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register). Any write operation to this bit takes a delay of 1 APB clock cycle to become effective..
Allowed values:
0x0: B_0x0: Break inputs (BRK and CCS clock failure event) disabled
Bit 13: Break polarity Note: This bit can not be modified as long as LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register). Any write operation to this bit takes a delay of 1 APB clock cycle to become effective..
Allowed values:
0x0: B_0x0: Break input BRK is active low
0x1: B_0x1: Break input BRK is active high
Bit 14: Automatic output enable Note: This bit can not be modified as long as LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: MOE can be set only by software
0x1: B_0x1: MOE can be set by software or automatically at the next update event (if the break input is not be active)
Bit 15: Main output enable This bit is cleared asynchronously by hardware as soon as the break input is active. It is set by software or automatically depending on the AOE bit. It is acting only on the channels which are configured in output. enable register (TIM16_CCER)(TIMx_CCER)(x = 16 to 17) on page 846)..
Allowed values:
0x0: B_0x0: OC and OCN outputs are disabled or forced to idle state depending on the OSSI bit.
0x1: B_0x1: OC and OCN outputs are enabled if their respective enable bits are set (CCxE, CCxNE in TIMx_CCER register)See OC/OCN enable description for more details (
Bits 16-19: Break filter This bit-field defines the frequency used to sample BRK input and the length of the digital filter applied to BRK. The digital filter is made of an event counter in which N events are needed to validate a transition on the output: This bit cannot be modified when LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: No filter, BRK acts asynchronously
0x1: B_0x1: fSAMPLING=fCK_INT, N=2
0x2: B_0x2: fSAMPLING=fCK_INT, N=4
0x3: B_0x3: fSAMPLING=fCK_INT, N=8
0x4: B_0x4: fSAMPLING=fDTS/2, N=6
0x5: B_0x5: fSAMPLING=fDTS/2, N=8
0x6: B_0x6: fSAMPLING=fDTS/4, N=6
0x7: B_0x7: fSAMPLING=fDTS/4, N=8
0x8: B_0x8: fSAMPLING=fDTS/8, N=6
0x9: B_0x9: fSAMPLING=fDTS/8, N=8
0xA: B_0xA: fSAMPLING=fDTS/16, N=5
0xB: B_0xB: fSAMPLING=fDTS/16, N=6
0xC: B_0xC: fSAMPLING=fDTS/16, N=8
0xD: B_0xD: fSAMPLING=fDTS/32, N=5
0xE: B_0xE: fSAMPLING=fDTS/32, N=6
0xF: B_0xF: fSAMPLING=fDTS/32, N=8
Bit 26: Break Disarm This bit is cleared by hardware when no break source is active. The BKDSRM bit must be set by software to release the bidirectional output control (open-drain output in Hi-Z state) and then be polled it until it is reset by hardware, indicating that the fault condition has disappeared. Note: Any write operation to this bit takes a delay of 1 APB clock cycle to become effective..
Allowed values:
0x0: B_0x0: Break input BRK is armed
0x1: B_0x1: Break input BRK is disarmed
Bit 28: Break Bidirectional In the bidirectional mode (BKBID bit set to 1), the break input is configured both in input mode and in open drain output mode. Any active break event asserts a low logic level on the Break input to indicate an internal break event to external devices. Note: This bit cannot be modified as long as LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register). Note: Any write operation to this bit takes a delay of 1 APB clock cycle to become effective..
Allowed values:
0x0: B_0x0: Break input BRK in input mode
0x1: B_0x1: Break input BRK in bidirectional mode
DMA control register
Offset: 0x48, reset: 0x0000, access: read-write
2/2 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
DBL
rw |
DBA
rw |
||||||||||||||
Bits 0-4: DMA base address This 5-bit field defines the base-address for DMA transfers (when read/write access are done through the TIMx_DMAR address). DBA is defined as an offset starting from the address of the TIMx_CR1 register. Example: ... Example: Let us consider the following transfer: DBL = 7 transfers and DBA = TIMx_CR1. In this case the transfer is done to/from 7 registers starting from the TIMx_CR1 address..
Allowed values:
0x0: B_0x0: TIMx_CR1,
0x1: B_0x1: TIMx_CR2,
0x2: B_0x2: TIMx_SMCR,
Bits 8-12: DMA burst length This 5-bit field defines the length of DMA transfers (the timer recognizes a burst transfer when a read or a write access is done to the TIMx_DMAR address), i.e. the number of transfers. Transfers can be in half-words or in bytes (see example below). ....
Allowed values:
0x0: B_0x0: 1 transfer,
0x1: B_0x1: 2 transfers,
0x2: B_0x2: 3 transfers,
0x11: B_0x11: 18 transfers.
DMA address for full transfer
Offset: 0x4C, reset: 0x0000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
DMAB
rw |
|||||||||||||||
TIM17 option register 1
Offset: 0x60, reset: 0x00000001, access: read-write
6/6 fields covered.
Bit 0: BRK BKIN input enable This bit enables the BKIN alternate function input for the timerâs BRK input. BKIN input is 'ORedâ with the other BRK sources. Note: This bit can not be modified as long as LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: BKIN input disabled
0x1: B_0x1: BKIN input enabled
Bit 1: BRK COMP1 enable This bit enables the COMP1 for the timerâs BRK input. COMP1 output is 'ORedâ with the other BRK sources. Note: This bit can not be modified as long as LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: COMP1 input disabled
0x1: B_0x1: COMP1 input enabled
Bit 2: BRK COMP2 enable This bit enables the COMP2 for the timerâs BRK input. COMP2 output is 'ORedâ with the other BRK sources. Note: This bit can not be modified as long as LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: COMP2 input disabled
0x1: B_0x1: COMP2 input enabled
Bit 9: BRK BKIN input polarity This bit selects the BKIN alternate function input sensitivity. It must be programmed together with the BKP polarity bit. Note: This bit can not be modified as long as LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: BKIN input is active low
0x1: B_0x1: BKIN input is active high
Bit 10: BRK COMP1 input polarity This bit selects the COMP1 input sensitivity. It must be programmed together with the BKP polarity bit. Note: This bit can not be modified as long as LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: COMP1 input is active low
0x1: B_0x1: COMP1 input is active high
Bit 11: BRK COMP2 input polarity This bit selects the COMP2 input sensitivity. It must be programmed together with the BKP polarity bit. Note: This bit can not be modified as long as LOCK level 1 has been programmed (LOCK bits in TIMx_BDTR register)..
Allowed values:
0x0: B_0x0: COMP2 input is active low
0x1: B_0x1: COMP2 input is active high
input selection register
Offset: 0x68, reset: 0x0000, access: read-write
1/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
TI1SEL
rw |
|||||||||||||||
0x40000400: General-purpose-timers
59/115 fields covered. Toggle Registers
| Offset | Name | 31 |
30 |
29 |
28 |
27 |
26 |
25 |
24 |
23 |
22 |
21 |
20 |
19 |
18 |
17 |
16 |
15 |
14 |
13 |
12 |
11 |
10 |
9 |
8 |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x0 | CR1 | ||||||||||||||||||||||||||||||||
| 0x4 | CR2 | ||||||||||||||||||||||||||||||||
| 0x8 | SMCR | ||||||||||||||||||||||||||||||||
| 0xC | DIER | ||||||||||||||||||||||||||||||||
| 0x10 | SR | ||||||||||||||||||||||||||||||||
| 0x14 | EGR | ||||||||||||||||||||||||||||||||
| 0x18 | CCMR1_Input | ||||||||||||||||||||||||||||||||
| 0x18 | CCMR1_Output | ||||||||||||||||||||||||||||||||
| 0x1C | CCMR2_Input | ||||||||||||||||||||||||||||||||
| 0x1C | CCMR2_Output | ||||||||||||||||||||||||||||||||
| 0x20 | CCER | ||||||||||||||||||||||||||||||||
| 0x24 | CNT | ||||||||||||||||||||||||||||||||
| 0x24 | CNT_ALTERNATE5 | ||||||||||||||||||||||||||||||||
| 0x28 | PSC | ||||||||||||||||||||||||||||||||
| 0x2C | ARR | ||||||||||||||||||||||||||||||||
| 0x34 | CCR1 | ||||||||||||||||||||||||||||||||
| 0x38 | CCR2 | ||||||||||||||||||||||||||||||||
| 0x3C | CCR3 | ||||||||||||||||||||||||||||||||
| 0x40 | CCR4 | ||||||||||||||||||||||||||||||||
| 0x48 | DCR | ||||||||||||||||||||||||||||||||
| 0x4C | DMAR | ||||||||||||||||||||||||||||||||
| 0x50 | OR1 | ||||||||||||||||||||||||||||||||
| 0x60 | AF1 | ||||||||||||||||||||||||||||||||
| 0x68 | TISEL | ||||||||||||||||||||||||||||||||
control register 1
Offset: 0x0, reset: 0x0000, access: read-write
9/9 fields covered.
Bit 0: Counter enable Note: External clock, gated mode and encoder mode can work only if the CEN bit has been previously set by software. However trigger mode can set the CEN bit automatically by hardware. CEN is cleared automatically in one-pulse mode, when an update event occurs..
Allowed values:
0x0: B_0x0: Counter disabled
0x1: B_0x1: Counter enabled
Bit 1: Update disable This bit is set and cleared by software to enable/disable UEV event generation. Counter overflow/underflow Setting the UG bit Update generation through the slave mode controller Buffered registers are then loaded with their preload values..
Allowed values:
0x0: B_0x0: UEV enabled. The Update (UEV) event is generated by one of the following events:
0x1: B_0x1: UEV disabled. The Update event is not generated, shadow registers keep their value (ARR, PSC, CCRx). However the counter and the prescaler are reinitialized if the UG bit is set or if a hardware reset is received from the slave mode controller.
Bit 2: Update request source This bit is set and cleared by software to select the UEV event sources. Counter overflow/underflow Setting the UG bit Update generation through the slave mode controller.
Allowed values:
0x0: B_0x0: Any of the following events generate an update interrupt or DMA request if enabled. These events can be:
0x1: B_0x1: Only counter overflow/underflow generates an update interrupt or DMA request if enabled.
Bits 5-6: Center-aligned mode selection Note: It is not allowed to switch from edge-aligned mode to center-aligned mode as long as the counter is enabled (CEN=1).
Allowed values:
0x0: B_0x0: Edge-aligned mode. The counter counts up or down depending on the direction bit (DIR).
0x1: B_0x1: Center-aligned mode 1. The counter counts up and down alternatively. Output compare interrupt flags of channels configured in output (CCxS=00 in TIMx_CCMRx register) are set only when the counter is counting down.
0x2: B_0x2: Center-aligned mode 2. The counter counts up and down alternatively. Output compare interrupt flags of channels configured in output (CCxS=00 in TIMx_CCMRx register) are set only when the counter is counting up.
0x3: B_0x3: Center-aligned mode 3. The counter counts up and down alternatively. Output compare interrupt flags of channels configured in output (CCxS=00 in TIMx_CCMRx register) are set both when the counter is counting up or down.
control register 2
Offset: 0x4, reset: 0x0000, access: read-write
3/3 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
TI1S
rw |
MMS
rw |
CCDS
rw |
|||||||||||||
Bits 4-6: Master mode selection These bits permit to select the information to be sent in master mode to slave timers for synchronization (TRGO). The combination is as follows: When the Counter Enable signal is controlled by the trigger input, there is a delay on TRGO, except if the master/slave mode is selected (see the MSM bit description in TIMx_SMCR register). Note: The clock of the slave timer or ADC must be enabled prior to receive events from the master timer, and must not be changed on-the-fly while triggers are received from the master timer..
Allowed values:
0x0: B_0x0: Reset - the UG bit from the TIMx_EGR register is used as trigger output (TRGO). If the reset is generated by the trigger input (slave mode controller configured in reset mode) then the signal on TRGO is delayed compared to the actual reset.
0x1: B_0x1: Enable - the Counter enable signal, CNT_EN, is used as trigger output (TRGO). It is useful to start several timers at the same time or to control a window in which a slave timer is enabled. The Counter Enable signal is generated by a logic AND between CEN control bit and the trigger input when configured in gated mode.
0x2: B_0x2: Update - The update event is selected as trigger output (TRGO). For instance a master timer can then be used as a prescaler for a slave timer.
0x3: B_0x3: Compare Pulse - The trigger output send a positive pulse when the CC1IF flag is to be set (even if it was already high), as soon as a capture or a compare match occurred. (TRGO)
0x4: B_0x4: Compare - OC1REFC signal is used as trigger output (TRGO)
0x5: B_0x5: Compare - OC2REFC signal is used as trigger output (TRGO)
0x6: B_0x6: Compare - OC3REFC signal is used as trigger output (TRGO)
0x7: B_0x7: Compare - OC4REFC signal is used as trigger output (TRGO)
slave mode control register
Offset: 0x8, reset: 0x0000, access: read-write
6/10 fields covered.
Bits 0-2: Slave mode selection When external signals are selected the active edge of the trigger signal (TRGI) is linked to the polarity selected on the external input (see Input Control register and Control Register description. reinitializes the counter, generates an update of the registers and starts the counter. Note: The gated mode must not be used if TI1F_ED is selected as the trigger input (TS=00100). Indeed, TI1F_ED outputs 1 pulse for each transition on TI1F, whereas the gated mode checks the level of the trigger signal. Note: The clock of the slave peripherals (timer, ADC, ...) receiving the TRGO or the TRGO2 signals must be enabled prior to receive events from the master timer, and the clock frequency (prescaler) must not be changed on-the-fly while triggers are received from the master timer..
Bits 4-6: Trigger selection This bit-field selects the trigger input to be used to synchronize the counter. Others: Reserved See for more details on ITRx meaning for each Timer. Note: These bits must be changed only when they are not used (e.g. when SMS=000) to avoid wrong edge detections at the transition..
Bit 7: Master/Slave mode.
Allowed values:
0x0: B_0x0: No action
0x1: B_0x1: The effect of an event on the trigger input (TRGI) is delayed to allow a perfect synchronization between the current timer and its slaves (through TRGO). It is useful if we want to synchronize several timers on a single external event.
Bits 8-11: External trigger filter This bit-field then defines the frequency used to sample ETRP signal and the length of the digital filter applied to ETRP. The digital filter is made of an event counter in which N consecutive events are needed to validate a transition on the output:.
Allowed values:
0x0: B_0x0: No filter, sampling is done at fDTS
0x1: B_0x1: fSAMPLING=fCK_INT, N=2
0x2: B_0x2: fSAMPLING=fCK_INT, N=4
0x3: B_0x3: fSAMPLING=fCK_INT, N=8
0x4: B_0x4: fSAMPLING=fDTS/2, N=6
0x5: B_0x5: fSAMPLING=fDTS/2, N=8
0x6: B_0x6: fSAMPLING=fDTS/4, N=6
0x7: B_0x7: fSAMPLING=fDTS/4, N=8
0x8: B_0x8: fSAMPLING=fDTS/8, N=6
0x9: B_0x9: fSAMPLING=fDTS/8, N=8
0xA: B_0xA: fSAMPLING=fDTS/16, N=5
0xB: B_0xB: fSAMPLING=fDTS/16, N=6
0xC: B_0xC: fSAMPLING=fDTS/16, N=8
0xD: B_0xD: fSAMPLING=fDTS/32, N=5
0xE: B_0xE: fSAMPLING=fDTS/32, N=6
0xF: B_0xF: fSAMPLING=fDTS/32, N=8
Bits 12-13: External trigger prescaler External trigger signal ETRP frequency must be at most 1/4 of CK_INT frequency. A prescaler can be enabled to reduce ETRP frequency. It is useful when inputting fast external clocks..
Allowed values:
0x0: B_0x0: Prescaler OFF
0x1: B_0x1: ETRP frequency divided by 2
0x2: B_0x2: ETRP frequency divided by 4
0x3: B_0x3: ETRP frequency divided by 8
Bit 14: External clock enable This bit enables External clock mode 2. Note: Setting the ECE bit has the same effect as selecting external clock mode 1 with TRGI connected to ETRF (SMS=111 and TS=00111). It is possible to simultaneously use external clock mode 2 with the following slave modes: reset mode, gated mode and trigger mode. Nevertheless, TRGI must not be connected to ETRF in this case (TS bits must not be 00111). If external clock mode 1 and external clock mode 2 are enabled at the same time, the external clock input is ETRF..
Allowed values:
0x0: B_0x0: External clock mode 2 disabled
0x1: B_0x1: External clock mode 2 enabled. The counter is clocked by any active edge on the ETRF signal.
Bit 16: Slave mode selection When external signals are selected the active edge of the trigger signal (TRGI) is linked to the polarity selected on the external input (see Input Control register and Control Register description. reinitializes the counter, generates an update of the registers and starts the counter. Note: The gated mode must not be used if TI1F_ED is selected as the trigger input (TS=00100). Indeed, TI1F_ED outputs 1 pulse for each transition on TI1F, whereas the gated mode checks the level of the trigger signal. Note: The clock of the slave peripherals (timer, ADC, ...) receiving the TRGO or the TRGO2 signals must be enabled prior to receive events from the master timer, and the clock frequency (prescaler) must not be changed on-the-fly while triggers are received from the master timer..
Bits 20-21: Trigger selection This bit-field selects the trigger input to be used to synchronize the counter. Others: Reserved See for more details on ITRx meaning for each Timer. Note: These bits must be changed only when they are not used (e.g. when SMS=000) to avoid wrong edge detections at the transition..
status register
Offset: 0x10, reset: 0x0000, access: read-write
4/10 fields covered.
Bit 0: Update interrupt flag This bit is set by hardware on an update event. It is cleared by software. At overflow or underflow and if UDIS=0 in the TIMx_CR1 register. When CNT is reinitialized by software using the UG bit in TIMx_EGR register, if URS=0 and UDIS=0 in the TIMx_CR1 register. When CNT is reinitialized by a trigger event (refer to the synchro control register description), if URS=0 and UDIS=0 in the TIMx_CR1 register..
Allowed values:
0x0: B_0x0: No update occurred
0x1: B_0x1: Update interrupt pending. This bit is set by hardware when the registers are updated:
Bit 1: Capture/compare 1 interrupt flag This flag is set by hardware. It is cleared by software (input capture or output compare mode) or by reading the TIMx_CCR1 register (input capture mode only). If channel CC1 is configured as output: this flag is set when the content of the counter TIMx_CNT matches the content of the TIMx_CCR1 register. When the content of TIMx_CCR1 is greater than the content of TIMx_ARR, the CC1IF bit goes high on the counter overflow (in up-counting and up/down-counting modes) or underflow (in down-counting mode). There are 3 possible options for flag setting in center-aligned mode, refer to the CMS bits in the TIMx_CR1 register for the full description. If channel CC1 is configured as input: this bit is set when counter value has been captured in TIMx_CCR1 register (an edge has been detected on IC1, as per the edge sensitivity defined with the CC1P and CC1NP bits setting, in TIMx_CCER)..
Allowed values:
0x0: B_0x0: No compare match / No input capture occurred
0x1: B_0x1: A compare match or an input capture occurred
Bit 6: Trigger interrupt flag This flag is set by hardware on the TRG trigger event (active edge detected on TRGI input when the slave mode controller is enabled in all modes but gated mode. It is set when the counter starts or stops when gated mode is selected. It is cleared by software..
Allowed values:
0x0: B_0x0: No trigger event occurred.
0x1: B_0x1: Trigger interrupt pending.
Bit 9: Capture/Compare 1 overcapture flag This flag is set by hardware only when the corresponding channel is configured in input capture mode. It is cleared by software by writing it to '0â..
Allowed values:
0x0: B_0x0: No overcapture has been detected.
0x1: B_0x1: The counter value has been captured in TIMx_CCR1 register while CC1IF flag was already set
event generation register
Offset: 0x14, reset: 0x0000, access: write-only
3/6 fields covered.
Bit 0: Update generation This bit can be set by software, it is automatically cleared by hardware..
Allowed values:
0x0: B_0x0: No action
0x1: B_0x1: Re-initialize the counter and generates an update of the registers. Note that the prescaler counter is cleared too (anyway the prescaler ratio is not affected). The counter is cleared if the center-aligned mode is selected or if DIR=0 (upcounting), else it takes the auto-reload value (TIMx_ARR) if DIR=1 (downcounting).
Bit 1: Capture/compare 1 generation This bit is set by software in order to generate an event, it is automatically cleared by hardware. If channel CC1 is configured as output: CC1IF flag is set, Corresponding interrupt or DMA request is sent if enabled. If channel CC1 is configured as input: The current value of the counter is captured in TIMx_CCR1 register. The CC1IF flag is set, the corresponding interrupt or DMA request is sent if enabled. The CC1OF flag is set if the CC1IF flag was already high..
Allowed values:
0x0: B_0x0: No action
0x1: B_0x1: A capture/compare event is generated on channel 1:
capture/compare mode register 1 (output mode)
Offset: 0x18, reset: 0x00000000, access: read-write
8/12 fields covered.
Bits 0-1: Capture/Compare 1 selection This bit-field defines the direction of the channel (input/output) as well as the used input. Note: CC1S bits are writable only when the channel is OFF (CC1E = 0 in TIMx_CCER)..
Allowed values:
0x0: B_0x0: CC1 channel is configured as output
0x1: B_0x1: CC1 channel is configured as input, IC1 is mapped on TI1
0x2: B_0x2: CC1 channel is configured as input, IC1 is mapped on TI2
0x3: B_0x3: CC1 channel is configured as input, IC1 is mapped on TRC. This mode is working only if an internal trigger input is selected through TS bit (TIMx_SMCR register)
Bit 3: Output compare 1 preload enable Note: The PWM mode can be used without validating the preload register only in one-pulse mode (OPM bit set in TIMx_CR1 register). Else the behavior is not guaranteed..
Allowed values:
0x0: B_0x0: Preload register on TIMx_CCR1 disabled. TIMx_CCR1 can be written at anytime, the new value is taken in account immediately.
0x1: B_0x1: Preload register on TIMx_CCR1 enabled. Read/Write operations access the preload register. TIMx_CCR1 preload value is loaded in the active register at each update event.
Bits 4-6: Output compare 1 mode These bits define the behavior of the output reference signal OC1REF from which OC1 and OC1N are derived. OC1REF is active high whereas OC1 and OC1N active level depends on CC1P and CC1NP bits. Note: In PWM mode, the OCREF level changes only when the result of the comparison changes or when the output compare mode switches from âfrozenâ mode to âPWMâ mode. Note: The OC1M[3] bit is not contiguous, located in bit 16..
Allowed values:
0: Frozen: The comparison between the output compare register TIMx_CCRy and the counter TIMx_CNT has no effect on the outputs / OpmMode1: Retriggerable OPM mode 1 - In up-counting mode, the channel is active until a trigger event is detected (on TRGI signal). In down-counting mode, the channel is inactive
1: ActiveOnMatch: Set channel to active level on match. OCyREF signal is forced high when the counter matches the capture/compare register / OpmMode2: Inversely to OpmMode1
2: InactiveOnMatch: Set channel to inactive level on match. OCyREF signal is forced low when the counter matches the capture/compare register / Reserved
3: Toggle: OCyREF toggles when TIMx_CNT=TIMx_CCRy / Reserved
4: ForceInactive: OCyREF is forced low / CombinedPwmMode1: OCyREF has the same behavior as in PWM mode 1. OCyREFC is the logical OR between OC1REF and OC2REF
5: ForceActive: OCyREF is forced high / CombinedPwmMode2: OCyREF has the same behavior as in PWM mode 2. OCyREFC is the logical AND between OC1REF and OC2REF
6: PwmMode1: In upcounting, channel is active as long as TIMx_CNT
7: PwmMode2: Inversely to PwmMode1 / AsymmetricPwmMode2: Inversely to AsymmetricPwmMode1
Bits 8-9: Capture/compare 2 selection This bit-field defines the direction of the channel (input/output) as well as the used input. Note: CC2S bits are writable only when the channel is OFF (CC2E = 0 in TIMx_CCER)..
Allowed values:
0x0: B_0x0: CC2 channel is configured as output.
0x1: B_0x1: CC2 channel is configured as input, IC2 is mapped on TI2.
0x2: B_0x2: CC2 channel is configured as input, IC2 is mapped on TI1.
0x3: B_0x3: CC2 channel is configured as input, IC2 is mapped on TRC. This mode is working only if an internal trigger input is selected through TS bit (TIMx_SMCR register)
Bits 12-14: Output compare 2 mode.
Allowed values:
0: Frozen: The comparison between the output compare register TIMx_CCRy and the counter TIMx_CNT has no effect on the outputs / OpmMode1: Retriggerable OPM mode 1 - In up-counting mode, the channel is active until a trigger event is detected (on TRGI signal). In down-counting mode, the channel is inactive
1: ActiveOnMatch: Set channel to active level on match. OCyREF signal is forced high when the counter matches the capture/compare register / OpmMode2: Inversely to OpmMode1
2: InactiveOnMatch: Set channel to inactive level on match. OCyREF signal is forced low when the counter matches the capture/compare register / Reserved
3: Toggle: OCyREF toggles when TIMx_CNT=TIMx_CCRy / Reserved
4: ForceInactive: OCyREF is forced low / CombinedPwmMode1: OCyREF has the same behavior as in PWM mode 1. OCyREFC is the logical OR between OC1REF and OC2REF
5: ForceActive: OCyREF is forced high / CombinedPwmMode2: OCyREF has the same behavior as in PWM mode 2. OCyREFC is the logical AND between OC1REF and OC2REF
6: PwmMode1: In upcounting, channel is active as long as TIMx_CNT
7: PwmMode2: Inversely to PwmMode1 / AsymmetricPwmMode2: Inversely to AsymmetricPwmMode1
capture/compare mode register 2 (input mode)
Offset: 0x1C, reset: 0x00000000, access: read-write
2/6 fields covered.
Bits 0-1: Capture/Compare 3 selection This bit-field defines the direction of the channel (input/output) as well as the used input. Note: CC3S bits are writable only when the channel is OFF (CC3E = 0 in TIMx_CCER)..
Allowed values:
0x0: B_0x0: CC3 channel is configured as output
0x1: B_0x1: CC3 channel is configured as input, IC3 is mapped on TI3
0x2: B_0x2: CC3 channel is configured as input, IC3 is mapped on TI4
0x3: B_0x3: CC3 channel is configured as input, IC3 is mapped on TRC. This mode is working only if an internal trigger input is selected through TS bit (TIMx_SMCR register)
Bits 8-9: Capture/Compare 4 selection This bit-field defines the direction of the channel (input/output) as well as the used input. Note: CC4S bits are writable only when the channel is OFF (CC4E = 0 in TIMx_CCER)..
Allowed values:
0x0: B_0x0: CC4 channel is configured as output
0x1: B_0x1: CC4 channel is configured as input, IC4 is mapped on TI4
0x2: B_0x2: CC4 channel is configured as input, IC4 is mapped on TI3
0x3: B_0x3: CC4 channel is configured as input, IC4 is mapped on TRC. This mode is working only if an internal trigger input is selected through TS bit (TIMx_SMCR register)
capture/compare mode register 2 (output mode)
Offset: 0x1C, reset: 0x00000000, access: read-write
4/12 fields covered.
Bits 4-6: Output compare 3 mode.
Allowed values:
0: Frozen: The comparison between the output compare register TIMx_CCRy and the counter TIMx_CNT has no effect on the outputs / OpmMode1: Retriggerable OPM mode 1 - In up-counting mode, the channel is active until a trigger event is detected (on TRGI signal). In down-counting mode, the channel is inactive
1: ActiveOnMatch: Set channel to active level on match. OCyREF signal is forced high when the counter matches the capture/compare register / OpmMode2: Inversely to OpmMode1
2: InactiveOnMatch: Set channel to inactive level on match. OCyREF signal is forced low when the counter matches the capture/compare register / Reserved
3: Toggle: OCyREF toggles when TIMx_CNT=TIMx_CCRy / Reserved
4: ForceInactive: OCyREF is forced low / CombinedPwmMode1: OCyREF has the same behavior as in PWM mode 1. OCyREFC is the logical OR between OC1REF and OC2REF
5: ForceActive: OCyREF is forced high / CombinedPwmMode2: OCyREF has the same behavior as in PWM mode 2. OCyREFC is the logical AND between OC1REF and OC2REF
6: PwmMode1: In upcounting, channel is active as long as TIMx_CNT
7: PwmMode2: Inversely to PwmMode1 / AsymmetricPwmMode2: Inversely to AsymmetricPwmMode1
Bits 12-14: Output compare 4 mode.
Allowed values:
0: Frozen: The comparison between the output compare register TIMx_CCRy and the counter TIMx_CNT has no effect on the outputs / OpmMode1: Retriggerable OPM mode 1 - In up-counting mode, the channel is active until a trigger event is detected (on TRGI signal). In down-counting mode, the channel is inactive
1: ActiveOnMatch: Set channel to active level on match. OCyREF signal is forced high when the counter matches the capture/compare register / OpmMode2: Inversely to OpmMode1
2: InactiveOnMatch: Set channel to inactive level on match. OCyREF signal is forced low when the counter matches the capture/compare register / Reserved
3: Toggle: OCyREF toggles when TIMx_CNT=TIMx_CCRy / Reserved
4: ForceInactive: OCyREF is forced low / CombinedPwmMode1: OCyREF has the same behavior as in PWM mode 1. OCyREFC is the logical OR between OC1REF and OC2REF
5: ForceActive: OCyREF is forced high / CombinedPwmMode2: OCyREF has the same behavior as in PWM mode 2. OCyREFC is the logical AND between OC1REF and OC2REF
6: PwmMode1: In upcounting, channel is active as long as TIMx_CNT
7: PwmMode2: Inversely to PwmMode1 / AsymmetricPwmMode2: Inversely to AsymmetricPwmMode1
capture/compare enable register
Offset: 0x20, reset: 0x0000, access: read-write
2/12 fields covered.
Bit 1: Capture/Compare 1 output Polarity. When CC1 channel is configured as input, both CC1NP/CC1P bits select the active polarity of TI1FP1 and TI2FP1 for trigger or capture operations. CC1NP=0, CC1P=0: non-inverted/rising edge. The circuit is sensitive to TIxFP1 rising edge (capture or trigger operations in reset, external clock or trigger mode), TIxFP1 is not inverted (trigger operation in gated mode or encoder mode). CC1NP=0, CC1P=1: inverted/falling edge. The circuit is sensitive to TIxFP1 falling edge (capture or trigger operations in reset, external clock or trigger mode), TIxFP1 is inverted (trigger operation in gated mode or encoder mode). CC1NP=1, CC1P=1: non-inverted/both edges. The circuit is sensitive to both TIxFP1 rising and falling edges (capture or trigger operations in reset, external clock or trigger mode), TIxFP1is not inverted (trigger operation in gated mode). This configuration must not be used in encoder mode. CC1NP=1, CC1P=0: This configuration is reserved, it must not be used..
Allowed values:
0x0: B_0x0: OC1 active high (output mode) / Edge sensitivity selection (input mode, see below)
0x1: B_0x1: OC1 active low (output mode) / Edge sensitivity selection (input mode, see below)
counter
Offset: 0x24, reset: 0x00000000, access: read-write
0/2 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
CNT_H
rw |
|||||||||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
CNT_L
rw |
|||||||||||||||
counter
Offset: 0x24, reset: 0x00000000, access: read-write
0/2 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
UIFCPY
rw |
CNT
rw |
||||||||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
CNT
rw |
|||||||||||||||
prescaler
Offset: 0x28, reset: 0x0000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
PSC
rw |
|||||||||||||||
auto-reload register
Offset: 0x2C, reset: 0xFFFFFFFF, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
ARR
rw |
|||||||||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
ARR
rw |
|||||||||||||||
capture/compare register 1
Offset: 0x34, reset: 0x00000000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
CCR1
rw |
|||||||||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
CCR1
rw |
|||||||||||||||
Bits 0-31: High Capture/Compare 1 value (TIM2) nullLow Capture/Compare 1 value If channel CC1 is configured as output: CCR1 is the value to be loaded in the actual capture/compare 1 register (preload value). It is loaded permanently if the preload feature is not selected in the TIMx_CCMR1 register (bit OC1PE). Else the preload value is copied in the active capture/compare 1 register when an update event occurs. The active capture/compare register contains the value to be compared to the counter TIMx_CNT and signaled on OC1 output. If channel CC1is configured as input: CCR1 is the counter value transferred by the last input capture 1 event (IC1). The TIMx_CCR1 register is read-only and cannot be programmed..
capture/compare register 2
Offset: 0x38, reset: 0x00000000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
CCR2
rw |
|||||||||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
CCR2
rw |
|||||||||||||||
Bits 0-31: High Capture/Compare 2 value (TIM2) nullLow Capture/Compare 2 value If channel CC2 is configured as output: CCR2 is the value to be loaded in the actual capture/compare 2 register (preload value). It is loaded permanently if the preload feature is not selected in the TIMx_CCMR1 register (bit OC2PE). Else the preload value is copied in the active capture/compare 2 register when an update event occurs. The active capture/compare register contains the value to be compared to the counter TIMx_CNT and signalled on OC2 output. If channel CC2 is configured as input: CCR2 is the counter value transferred by the last input capture 2 event (IC2). The TIMx_CCR2 register is read-only and cannot be programmed..
capture/compare register 3
Offset: 0x3C, reset: 0x00000000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
CCR3
rw |
|||||||||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
CCR3
rw |
|||||||||||||||
Bits 0-31: High Capture/Compare 3 value (TIM2) nullLow Capture/Compare value If channel CC3 is configured as output: CCR3 is the value to be loaded in the actual capture/compare 3 register (preload value). It is loaded permanently if the preload feature is not selected in the TIMx_CCMR2 register (bit OC3PE). Else the preload value is copied in the active capture/compare 3 register when an update event occurs. The active capture/compare register contains the value to be compared to the counter TIMx_CNT and signalled on OC3 output. If channel CC3is configured as input: CCR3 is the counter value transferred by the last input capture 3 event (IC3). The TIMx_CCR3 register is read-only and cannot be programmed..
capture/compare register 4
Offset: 0x40, reset: 0x00000000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
CCR4
rw |
|||||||||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
CCR4
rw |
|||||||||||||||
Bits 0-31: High Capture/Compare 4 value (TIM2) nullLow Capture/Compare value if CC4 channel is configured as output (CC4S bits): CCR4 is the value to be loaded in the actual capture/compare 4 register (preload value). It is loaded permanently if the preload feature is not selected in the TIMx_CCMR2 register (bit OC4PE). Else the preload value is copied in the active capture/compare 4 register when an update event occurs. The active capture/compare register contains the value to be compared to the counter TIMx_CNT and signalled on OC4 output. if CC4 channel is configured as input (CC4S bits in TIMx_CCMR4 register): CCR4 is the counter value transferred by the last input capture 4 event (IC4). The TIMx_CCR4 register is read-only and cannot be programmed..
DMA control register
Offset: 0x48, reset: 0x0000, access: read-write
2/2 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
DBL
rw |
DBA
rw |
||||||||||||||
Bits 0-4: DMA base address This 5-bit vector defines the base-address for DMA transfers (when read/write access are done through the TIMx_DMAR address). DBA is defined as an offset starting from the address of the TIMx_CR1 register. Example: ... Example: Let us consider the following transfer: DBL = 7 transfers & DBA = TIMx_CR1. In this case the transfer is done to/from 7 registers starting from the TIMx_CR1 address..
Allowed values:
0x0: B_0x0: TIMx_CR1
0x1: B_0x1: TIMx_CR2
0x2: B_0x2: TIMx_SMCR
Bits 8-12: DMA burst length This 5-bit vector defines the number of DMA transfers (the timer recognizes a burst transfer when a read or a write access is done to the TIMx_DMAR address). ....
Allowed values:
0x0: B_0x0: 1 transfer,
0x1: B_0x1: 2 transfers,
0x2: B_0x2: 3 transfers,
0x11: B_0x11: 18 transfers.
DMA address for full transfer
Offset: 0x4C, reset: 0x0000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
DMAB
rw |
|||||||||||||||
TIM option register
Offset: 0x50, reset: 0x0000, access: read-write
1/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
OCREF_CLR
rw |
|||||||||||||||
TIM alternate function option register 1
Offset: 0x60, reset: 0x0000, access: read-write
1/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
ETRSEL
rw |
|||||||||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
ETRSEL
rw |
|||||||||||||||
TIM alternate function option register 1
Offset: 0x68, reset: 0x0000, access: read-write
2/2 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
TI2SEL
rw |
TI1SEL
rw |
||||||||||||||
0x40001000: Basic timers
12/15 fields covered. Toggle Registers
| Offset | Name | 31 |
30 |
29 |
28 |
27 |
26 |
25 |
24 |
23 |
22 |
21 |
20 |
19 |
18 |
17 |
16 |
15 |
14 |
13 |
12 |
11 |
10 |
9 |
8 |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x0 | CR1 | ||||||||||||||||||||||||||||||||
| 0x4 | CR2 | ||||||||||||||||||||||||||||||||
| 0xC | DIER | ||||||||||||||||||||||||||||||||
| 0x10 | SR | ||||||||||||||||||||||||||||||||
| 0x14 | EGR | ||||||||||||||||||||||||||||||||
| 0x24 | CNT | ||||||||||||||||||||||||||||||||
| 0x28 | PSC | ||||||||||||||||||||||||||||||||
| 0x2C | ARR | ||||||||||||||||||||||||||||||||
control register 1
Offset: 0x0, reset: 0x0000, access: read-write
6/6 fields covered.
Bit 0: Counter enable Note: Gated mode can work only if the CEN bit has been previously set by software. However trigger mode can set the CEN bit automatically by hardware. CEN is cleared automatically in one-pulse mode, when an update event occurs..
Allowed values:
0x0: B_0x0: Counter disabled
0x1: B_0x1: Counter enabled
Bit 1: Update disable This bit is set and cleared by software to enable/disable UEV event generation. Counter overflow/underflow Setting the UG bit Update generation through the slave mode controller Buffered registers are then loaded with their preload values..
Allowed values:
0x0: B_0x0: UEV enabled. The Update (UEV) event is generated by one of the following events:
0x1: B_0x1: UEV disabled. The Update event is not generated, shadow registers keep their value (ARR, PSC). However the counter and the prescaler are reinitialized if the UG bit is set or if a hardware reset is received from the slave mode controller.
Bit 2: Update request source This bit is set and cleared by software to select the UEV event sources. Counter overflow/underflow Setting the UG bit Update generation through the slave mode controller.
Allowed values:
0x0: B_0x0: Any of the following events generates an update interrupt or DMA request if enabled. These events can be:
0x1: B_0x1: Only counter overflow/underflow generates an update interrupt or DMA request if enabled.
control register 2
Offset: 0x4, reset: 0x0000, access: read-write
1/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
MMS
rw |
|||||||||||||||
Bits 4-6: Master mode selection These bits are used to select the information to be sent in master mode to slave timers for synchronization (TRGO). The combination is as follows: When the Counter Enable signal is controlled by the trigger input, there is a delay on TRGO, except if the master/slave mode is selected (see the MSM bit description in the TIMx_SMCR register). Note: The clock of the slave timer or ADC must be enabled prior to receive events from the master timer, and must not be changed on-the-fly while triggers are received from the master timer..
Allowed values:
0x0: B_0x0: Reset - the UG bit from the TIMx_EGR register is used as a trigger output (TRGO). If reset is generated by the trigger input (slave mode controller configured in reset mode) then the signal on TRGO is delayed compared to the actual reset.
0x1: B_0x1: Enable - the Counter enable signal, CNT_EN, is used as a trigger output (TRGO). It is useful to start several timers at the same time or to control a window in which a slave timer is enabled. The Counter Enable signal is generated by a logic OR between CEN control bit and the trigger input when configured in gated mode.
0x2: B_0x2: Update - The update event is selected as a trigger output (TRGO). For instance a master timer can then be used as a prescaler for a slave timer.
DMA/Interrupt enable register
Offset: 0xC, reset: 0x0000, access: read-write
2/2 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
UDE
rw |
UIE
rw |
||||||||||||||
status register
Offset: 0x10, reset: 0x0000, access: read-write
1/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
UIF
rw |
|||||||||||||||
Bit 0: Update interrupt flag This bit is set by hardware on an update event. It is cleared by software. At overflow or underflow regarding the repetition counter value and if UDIS = 0 in the TIMx_CR1 register. When CNT is reinitialized by software using the UG bit in the TIMx_EGR register, if URS = 0 and UDIS = 0 in the TIMx_CR1 register..
Allowed values:
0x0: B_0x0: No update occurred.
0x1: B_0x1: Update interrupt pending. This bit is set by hardware when the registers are updated:
event generation register
Offset: 0x14, reset: 0x0000, access: write-only
1/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
UG
w |
|||||||||||||||
Bit 0: Update generation This bit can be set by software, it is automatically cleared by hardware..
Allowed values:
0x0: B_0x0: No action.
0x1: B_0x1: Re-initializes the timer counter and generates an update of the registers. Note that the prescaler counter is cleared too (but the prescaler ratio is not affected).
counter
Offset: 0x24, reset: 0x00000000, access: read-write
1/2 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
UIFCPY
r |
|||||||||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
CNT
rw |
|||||||||||||||
prescaler
Offset: 0x28, reset: 0x0000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
PSC
rw |
|||||||||||||||
auto-reload register
Offset: 0x2C, reset: 0x0000FFFF, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
ARR
rw |
|||||||||||||||
0x40001400: Basic timers
12/15 fields covered. Toggle Registers
| Offset | Name | 31 |
30 |
29 |
28 |
27 |
26 |
25 |
24 |
23 |
22 |
21 |
20 |
19 |
18 |
17 |
16 |
15 |
14 |
13 |
12 |
11 |
10 |
9 |
8 |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x0 | CR1 | ||||||||||||||||||||||||||||||||
| 0x4 | CR2 | ||||||||||||||||||||||||||||||||
| 0xC | DIER | ||||||||||||||||||||||||||||||||
| 0x10 | SR | ||||||||||||||||||||||||||||||||
| 0x14 | EGR | ||||||||||||||||||||||||||||||||
| 0x24 | CNT | ||||||||||||||||||||||||||||||||
| 0x28 | PSC | ||||||||||||||||||||||||||||||||
| 0x2C | ARR | ||||||||||||||||||||||||||||||||
control register 1
Offset: 0x0, reset: 0x0000, access: read-write
6/6 fields covered.
Bit 0: Counter enable Note: Gated mode can work only if the CEN bit has been previously set by software. However trigger mode can set the CEN bit automatically by hardware. CEN is cleared automatically in one-pulse mode, when an update event occurs..
Allowed values:
0x0: B_0x0: Counter disabled
0x1: B_0x1: Counter enabled
Bit 1: Update disable This bit is set and cleared by software to enable/disable UEV event generation. Counter overflow/underflow Setting the UG bit Update generation through the slave mode controller Buffered registers are then loaded with their preload values..
Allowed values:
0x0: B_0x0: UEV enabled. The Update (UEV) event is generated by one of the following events:
0x1: B_0x1: UEV disabled. The Update event is not generated, shadow registers keep their value (ARR, PSC). However the counter and the prescaler are reinitialized if the UG bit is set or if a hardware reset is received from the slave mode controller.
Bit 2: Update request source This bit is set and cleared by software to select the UEV event sources. Counter overflow/underflow Setting the UG bit Update generation through the slave mode controller.
Allowed values:
0x0: B_0x0: Any of the following events generates an update interrupt or DMA request if enabled. These events can be:
0x1: B_0x1: Only counter overflow/underflow generates an update interrupt or DMA request if enabled.
control register 2
Offset: 0x4, reset: 0x0000, access: read-write
1/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
MMS
rw |
|||||||||||||||
Bits 4-6: Master mode selection These bits are used to select the information to be sent in master mode to slave timers for synchronization (TRGO). The combination is as follows: When the Counter Enable signal is controlled by the trigger input, there is a delay on TRGO, except if the master/slave mode is selected (see the MSM bit description in the TIMx_SMCR register). Note: The clock of the slave timer or ADC must be enabled prior to receive events from the master timer, and must not be changed on-the-fly while triggers are received from the master timer..
Allowed values:
0x0: B_0x0: Reset - the UG bit from the TIMx_EGR register is used as a trigger output (TRGO). If reset is generated by the trigger input (slave mode controller configured in reset mode) then the signal on TRGO is delayed compared to the actual reset.
0x1: B_0x1: Enable - the Counter enable signal, CNT_EN, is used as a trigger output (TRGO). It is useful to start several timers at the same time or to control a window in which a slave timer is enabled. The Counter Enable signal is generated by a logic OR between CEN control bit and the trigger input when configured in gated mode.
0x2: B_0x2: Update - The update event is selected as a trigger output (TRGO). For instance a master timer can then be used as a prescaler for a slave timer.
DMA/Interrupt enable register
Offset: 0xC, reset: 0x0000, access: read-write
2/2 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
UDE
rw |
UIE
rw |
||||||||||||||
status register
Offset: 0x10, reset: 0x0000, access: read-write
1/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
UIF
rw |
|||||||||||||||
Bit 0: Update interrupt flag This bit is set by hardware on an update event. It is cleared by software. At overflow or underflow regarding the repetition counter value and if UDIS = 0 in the TIMx_CR1 register. When CNT is reinitialized by software using the UG bit in the TIMx_EGR register, if URS = 0 and UDIS = 0 in the TIMx_CR1 register..
Allowed values:
0x0: B_0x0: No update occurred.
0x1: B_0x1: Update interrupt pending. This bit is set by hardware when the registers are updated:
event generation register
Offset: 0x14, reset: 0x0000, access: write-only
1/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
UG
w |
|||||||||||||||
Bit 0: Update generation This bit can be set by software, it is automatically cleared by hardware..
Allowed values:
0x0: B_0x0: No action.
0x1: B_0x1: Re-initializes the timer counter and generates an update of the registers. Note that the prescaler counter is cleared too (but the prescaler ratio is not affected).
counter
Offset: 0x24, reset: 0x00000000, access: read-write
1/2 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
UIFCPY
r |
|||||||||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
CNT
rw |
|||||||||||||||
prescaler
Offset: 0x28, reset: 0x0000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
PSC
rw |
|||||||||||||||
auto-reload register
Offset: 0x2C, reset: 0x0000FFFF, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
ARR
rw |
|||||||||||||||
0x40013800: Universal synchronous asynchronous receiver transmitter
136/170 fields covered. Toggle Registers
| Offset | Name | 31 |
30 |
29 |
28 |
27 |
26 |
25 |
24 |
23 |
22 |
21 |
20 |
19 |
18 |
17 |
16 |
15 |
14 |
13 |
12 |
11 |
10 |
9 |
8 |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x0 | CR1_FIFO_DISABLED | ||||||||||||||||||||||||||||||||
| 0x0 | CR1_FIFO_ENABLED | ||||||||||||||||||||||||||||||||
| 0x4 | CR2 | ||||||||||||||||||||||||||||||||
| 0x8 | CR3 | ||||||||||||||||||||||||||||||||
| 0xC | BRR | ||||||||||||||||||||||||||||||||
| 0x10 | GTPR | ||||||||||||||||||||||||||||||||
| 0x14 | RTOR | ||||||||||||||||||||||||||||||||
| 0x18 | RQR | ||||||||||||||||||||||||||||||||
| 0x1C | ISR_FIFO_DISABLED | ||||||||||||||||||||||||||||||||
| 0x1C | ISR_FIFO_ENABLED | ||||||||||||||||||||||||||||||||
| 0x20 | ICR | ||||||||||||||||||||||||||||||||
| 0x24 | RDR | ||||||||||||||||||||||||||||||||
| 0x28 | TDR | ||||||||||||||||||||||||||||||||
| 0x2C | PRESC | ||||||||||||||||||||||||||||||||
Control register 1
Offset: 0x0, reset: 0x0000, access: read-write
18/22 fields covered.
Bit 0: USART enable When this bit is cleared, the USART prescalers and outputs are stopped immediately, and all current operations are discarded. The USART configuration is kept, but all the USART_ISR status flags are reset. This bit is set and cleared by software. Note: To enter low-power mode without generating errors on the line, the TE bit must be previously reset and the software must wait for the TC bit in the USART_ISR to be set before resetting the UE bit. The DMA requests are also reset when UE = 0 so the DMA channel must be disabled before resetting the UE bit. In Smartcard mode, (SCEN = 1), the SCLK is always available when CLKEN = 1, regardless of the UE bit value..
Allowed values:
0x0: B_0x0: USART prescaler and outputs disabled, low-power mode
0x1: B_0x1: USART enabled
Bit 1: USART enable in low-power mode When this bit is cleared, the USART cannot wake up the MCU from low-power mode. When this bit is set, the USART can wake up the MCU from low-power mode. This bit is set and cleared by software. Note: It is recommended to set the UESM bit just before entering low-power mode and clear it when exit from low-power mode. If the USART does not support the wakeup from Stop feature, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: USART not able to wake up the MCU from low-power mode.
0x1: B_0x1: USART able to wake up the MCU from low-power mode.
Bit 3: Transmitter enable This bit enables the transmitter. It is set and cleared by software. Note: During transmission, a low pulse on the TE bit ('0â followed by '1â) sends a preamble (idle line) after the current word, except in Smartcard mode. In order to generate an idle character, the TE must not be immediately written to '1â. To ensure the required duration, the software can poll the TEACK bit in the USART_ISR register. In Smartcard mode, when TE is set, there is a 1 bit-time delay before the transmission starts..
Allowed values:
0x0: B_0x0: Transmitter is disabled
0x1: B_0x1: Transmitter is enabled
Bit 9: Parity selection This bit selects the odd or even parity when the parity generation/detection is enabled (PCE bit set). It is set and cleared by software. The parity is selected after the current byte. This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: Even parity
0x1: B_0x1: Odd parity
Bit 10: Parity control enable This bit selects the hardware parity control (generation and detection). When the parity control is enabled, the computed parity is inserted at the MSB position (9th bit if MÂ =Â 1; 8th bit if MÂ =Â 0) and the parity is checked on the received data. This bit is set and cleared by software. Once it is set, PCE is active after the current byte (in reception and in transmission). This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: Parity control disabled
0x1: B_0x1: Parity control enabled
Bit 13: Mute mode enable This bit enables the USART Mute mode function. When set, the USART can switch between active and Mute mode, as defined by the WAKE bit. It is set and cleared by software..
Allowed values:
0x0: B_0x0: Receiver in active mode permanently
0x1: B_0x1: Receiver can switch between Mute mode and active mode.
Bits 16-20: Driver Enable deassertion time This 5-bit value defines the time between the end of the last stop bit, in a transmitted message, and the de-activation of the DE (Driver Enable) signal. It is expressed in sample time units (1/8 or 1/16 bit time, depending on the oversampling rate). If the USART_TDR register is written during the DEDT time, the new data is transmitted only when the DEDT and DEAT times have both elapsed. This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If the Driver Enable feature is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Bits 21-25: Driver Enable assertion time This 5-bit value defines the time between the activation of the DE (Driver Enable) signal and the beginning of the start bit. It is expressed in sample time units (1/8 or 1/16 bit time, depending on the oversampling rate). This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If the Driver Enable feature is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Bit 26: Receiver timeout interrupt enable This bit is set and cleared by software. Note: If the USART does not support the Receiver timeout feature, this bit is reserved and must be kept at reset value. ..
Allowed values:
0x0: B_0x0: Interrupt inhibited
0x1: B_0x1: USART interrupt generated when the RTOF bit is set in the USART_ISR register.
Bit 27: End of Block interrupt enable This bit is set and cleared by software. Note: If the USART does not support Smartcard mode, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Interrupt inhibited
0x1: B_0x1: USART interrupt generated when the EOBF flag is set in the USART_ISR register
Bit 28: Word length This bit must be used in conjunction with bit 12 (M0) to determine the word length. It is set or cleared by software. M[1:0] = '00â: 1 start bit, 8 Data bits, n Stop bit M[1:0] = '01â: 1 start bit, 9 Data bits, n Stop bit M[1:0] = '10â: 1 start bit, 7 Data bits, n Stop bit This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: In 7-bits data length mode, the Smartcard mode, LIN master mode and Auto baud rate (0x7F and 0x55 frames detection) are not supported..
Bit 29: FIFO mode enable This bit is set and cleared by software. This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: FIFO mode can be used on standard UART communication, in SPI master/slave mode and in Smartcard modes only. It must not be enabled in IrDA and LIN modes..
Allowed values:
0x0: B_0x0: FIFO mode is disabled.
0x1: B_0x1: FIFO mode is enabled.
Control register 1
Offset: 0x0, reset: 0x0000, access: read-write
20/24 fields covered.
Bit 0: USART enable When this bit is cleared, the USART prescalers and outputs are stopped immediately, and all current operations are discarded. The USART configuration is kept, but all the USART_ISR status flags are reset. This bit is set and cleared by software. Note: To enter low-power mode without generating errors on the line, the TE bit must be previously reset and the software must wait for the TC bit in the USART_ISR to be set before resetting the UE bit. The DMA requests are also reset when UE = 0 so the DMA channel must be disabled before resetting the UE bit. In Smartcard mode, (SCEN = 1), the SCLK is always available when CLKEN = 1, regardless of the UE bit value..
Allowed values:
0x0: B_0x0: USART prescaler and outputs disabled, low-power mode
0x1: B_0x1: USART enabled
Bit 1: USART enable in low-power mode When this bit is cleared, the USART cannot wake up the MCU from low-power mode. When this bit is set, the USART can wake up the MCU from low-power mode. This bit is set and cleared by software. Note: It is recommended to set the UESM bit just before entering low-power mode and clear it when exit from low-power mode. If the USART does not support the wakeup from Stop feature, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: USART not able to wake up the MCU from low-power mode.
0x1: B_0x1: USART able to wake up the MCU from low-power mode.
Bit 3: Transmitter enable This bit enables the transmitter. It is set and cleared by software. Note: During transmission, a low pulse on the TE bit ('0â followed by '1â) sends a preamble (idle line) after the current word, except in Smartcard mode. In order to generate an idle character, the TE must not be immediately written to '1â. To ensure the required duration, the software can poll the TEACK bit in the USART_ISR register. In Smartcard mode, when TE is set, there is a 1 bit-time delay before the transmission starts..
Allowed values:
0x0: B_0x0: Transmitter is disabled
0x1: B_0x1: Transmitter is enabled
Bit 9: Parity selection This bit selects the odd or even parity when the parity generation/detection is enabled (PCE bit set). It is set and cleared by software. The parity is selected after the current byte. This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: Even parity
0x1: B_0x1: Odd parity
Bit 10: Parity control enable This bit selects the hardware parity control (generation and detection). When the parity control is enabled, the computed parity is inserted at the MSB position (9th bit if MÂ =Â 1; 8th bit if MÂ =Â 0) and the parity is checked on the received data. This bit is set and cleared by software. Once it is set, PCE is active after the current byte (in reception and in transmission). This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: Parity control disabled
0x1: B_0x1: Parity control enabled
Bit 13: Mute mode enable This bit enables the USART Mute mode function. When set, the USART can switch between active and Mute mode, as defined by the WAKE bit. It is set and cleared by software..
Allowed values:
0x0: B_0x0: Receiver in active mode permanently
0x1: B_0x1: Receiver can switch between Mute mode and active mode.
Bits 16-20: Driver Enable deassertion time This 5-bit value defines the time between the end of the last stop bit, in a transmitted message, and the de-activation of the DE (Driver Enable) signal. It is expressed in sample time units (1/8 or 1/16 bit time, depending on the oversampling rate). If the USART_TDR register is written during the DEDT time, the new data is transmitted only when the DEDT and DEAT times have both elapsed. This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If the Driver Enable feature is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Bits 21-25: Driver Enable assertion time This 5-bit value defines the time between the activation of the DE (Driver Enable) signal and the beginning of the start bit. It is expressed in sample time units (1/8 or 1/16 bit time, depending on the oversampling rate). This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If the Driver Enable feature is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Bit 26: Receiver timeout interrupt enable This bit is set and cleared by software. Note: If the USART does not support the Receiver timeout feature, this bit is reserved and must be kept at reset value. ..
Allowed values:
0x0: B_0x0: Interrupt inhibited
0x1: B_0x1: USART interrupt generated when the RTOF bit is set in the USART_ISR register.
Bit 27: End of Block interrupt enable This bit is set and cleared by software. Note: If the USART does not support Smartcard mode, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Interrupt inhibited
0x1: B_0x1: USART interrupt generated when the EOBF flag is set in the USART_ISR register
Bit 28: Word length This bit must be used in conjunction with bit 12 (M0) to determine the word length. It is set or cleared by software. M[1:0] = '00â: 1 start bit, 8 Data bits, n Stop bit M[1:0] = '01â: 1 start bit, 9 Data bits, n Stop bit M[1:0] = '10â: 1 start bit, 7 Data bits, n Stop bit This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: In 7-bits data length mode, the Smartcard mode, LIN master mode and Auto baud rate (0x7F and 0x55 frames detection) are not supported..
Bit 29: FIFO mode enable This bit is set and cleared by software. This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: FIFO mode can be used on standard UART communication, in SPI master/slave mode and in Smartcard modes only. It must not be enabled in IrDA and LIN modes..
Allowed values:
0x0: B_0x0: FIFO mode is disabled.
0x1: B_0x1: FIFO mode is enabled.
Control register 2
Offset: 0x4, reset: 0x0000, access: read-write
19/20 fields covered.
Bit 3: When the DIS_NSS bit is set, the NSS pin input is ignored. Note: When SPI slave mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: SPI slave selection depends on NSS input pin.
0x1: B_0x1: SPI slave is always selected and NSS input pin is ignored.
Bit 4: 7-bit Address Detection/4-bit Address Detection This bit is for selection between 4-bit address detection or 7-bit address detection. This bit can only be written when the USART is disabled (UEÂ =Â 0) Note: In 7-bit and 9-bit data modes, the address detection is done on 6-bit and 8-bit address (ADD[5:0] and ADD[7:0]) respectively..
Allowed values:
0x0: B_0x0: 4-bit address detection
0x1: B_0x1: 7-bit address detection (in 8-bit data mode)
Bit 5: LIN break detection length This bit is for selection between 11 bit or 10 bit break detection. This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If LIN mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: 10-bit break detection
0x1: B_0x1: 11-bit break detection
Bit 6: LIN break detection interrupt enable Break interrupt mask (break detection using break delimiter). Note: If LIN mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Interrupt is inhibited
0x1: B_0x1: An interrupt is generated whenever LBDF = 1 in the USART_ISR register
Bit 8: Last bit clock pulse This bit is used to select whether the clock pulse associated with the last data bit transmitted (MSB) has to be output on the SCLK pin in synchronous mode. The last bit is the 7th or 8th or 9th data bit transmitted depending on the 7 or 8 or 9 bit format selected by the M bit in the USART_CR1 register. This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If synchronous mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: The clock pulse of the last data bit is not output to the SCLK pin
0x1: B_0x1: The clock pulse of the last data bit is output to the SCLK pin
Bit 9: Clock phase This bit is used to select the phase of the clock output on the SCLK pin in synchronous mode. It works in conjunction with the CPOL bit to produce the desired clock/data relationship (see and ) This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If synchronous mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: The first clock transition is the first data capture edge
0x1: B_0x1: The second clock transition is the first data capture edge
Bit 10: Clock polarity This bit enables the user to select the polarity of the clock output on the SCLK pin in synchronous mode. It works in conjunction with the CPHA bit to produce the desired clock/data relationship This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If synchronous mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Steady low value on SCLK pin outside transmission window
0x1: B_0x1: Steady high value on SCLK pin outside transmission window
Bit 11: Clock enable This bit enables the user to enable the SCLK pin. This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If neither synchronous mode nor Smartcard mode is supported, this bit is reserved and must be kept at reset value. Refer to . In Smartcard mode, in order to provide correctly the SCLK clock to the smartcard, the steps below must be respected: UE = 0 SCEN = 1 GTPR configuration CLKEN= 1 UE = 1.
Allowed values:
0x0: B_0x0: SCLK pin disabled
0x1: B_0x1: SCLK pin enabled
Bit 14: LIN mode enable This bit is set and cleared by software. The LIN mode enables the capability to send LIN synchronous breaks (13 low bits) using the SBKRQ bit in the USART_CR1 register, and to detect LIN Sync breaks. This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If the USART does not support LIN mode, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: LIN mode disabled
0x1: B_0x1: LIN mode enabled
Bit 15: Swap TX/RX pins This bit is set and cleared by software. This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: TX/RX pins are used as defined in standard pinout
0x1: B_0x1: The TX and RX pins functions are swapped. This enables to work in the case of a cross-wired connection to another UART.
Bit 16: RX pin active level inversion This bit is set and cleared by software. This enables the use of an external inverter on the RX line. This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: RX pin signal works using the standard logic levels (VDD =1/idle, Gnd = 0/mark)
0x1: B_0x1: RX pin signal values are inverted (VDD =0/mark, Gnd = 1/idle).
Bit 17: TX pin active level inversion This bit is set and cleared by software. This enables the use of an external inverter on the TX line. This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: TX pin signal works using the standard logic levels (VDD =1/idle, Gnd = 0/mark)
0x1: B_0x1: TX pin signal values are inverted (VDD =0/mark, Gnd = 1/idle).
Bit 18: Binary data inversion This bit is set and cleared by software. This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: Logical data from the data register are send/received in positive/direct logic. (1 = H, 0 = L)
0x1: B_0x1: Logical data from the data register are send/received in negative/inverse logic. (1 = L, 0 = H). The parity bit is also inverted.
Bit 19: Most significant bit first This bit is set and cleared by software. This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: data is transmitted/received with data bit 0 first, following the start bit.
0x1: B_0x1: data is transmitted/received with the MSB (bit 7/8) first, following the start bit.
Bit 20: Auto baud rate enable This bit is set and cleared by software. Note: If the USART does not support the auto baud rate feature, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Auto baud rate detection is disabled.
0x1: B_0x1: Auto baud rate detection is enabled.
Bits 21-22: Auto baud rate mode These bits are set and cleared by software. This bitfield can only be written when ABREN = 0 or the USART is disabled (UEÂ =Â 0). Note: If DATAINVÂ =Â 1 and/or MSBFIRSTÂ =Â 1 the patterns must be the same on the line, for example 0xAA for MSBFIRST) If the USART does not support the auto baud rate feature, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Measurement of the start bit is used to detect the baud rate.
0x1: B_0x1: Falling edge to falling edge measurement (the received frame must start with a single bit = 1 and Frame = Start10xxxxxx)
0x2: B_0x2: 0x7F frame detection.
0x3: B_0x3: 0x55 frame detection
Bit 23: Receiver timeout enable This bit is set and cleared by software. When this feature is enabled, the RTOF flag in the USART_ISR register is set if the RX line is idle (no reception) for the duration programmed in the RTOR (receiver timeout register). Note: If the USART does not support the Receiver timeout feature, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Receiver timeout feature disabled.
0x1: B_0x1: Receiver timeout feature enabled.
Bits 24-31: Address of the USART node ADD[7:4]: These bits give the address of the USART node or a character code to be recognized. They are used to wake up the MCU with 7-bit address mark detection in multiprocessor communication during Mute mode or low-power mode. The MSB of the character sent by the transmitter should be equal to 1. They can also be used for character detection during normal reception, Mute mode inactive (for example, end of block detection in ModBus protocol). In this case, the whole received character (8-bit) is compared to the ADD[7:0] value and CMF flag is set on match. These bits can only be written when reception is disabled (RE = 0) or the USART is disabled (UEÂ =Â 0). ADD[3:0]: These bits give the address of the USART node or a character code to be recognized. They are used for wakeup with address mark detection, in multiprocessor communication during Mute mode or low-power mode. These bits can only be written when reception is disabled (RE = 0) or the USART is disabled (UEÂ =Â 0)..
Control register 3
Offset: 0x8, reset: 0x0000, access: read-write
24/24 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
TXFTCFG
rw |
RXFTIE
rw |
RXFTCFG
rw |
TCBGTIE
rw |
TXFTIE
rw |
WUFIE
rw |
WUS
rw |
SCARCNT
rw |
||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
DEP
rw |
DEM
rw |
DDRE
rw |
OVRDIS
rw |
ONEBIT
rw |
CTSIE
rw |
CTSE
rw |
RTSE
rw |
DMAT
rw |
DMAR
rw |
SCEN
rw |
NACK
rw |
HDSEL
rw |
IRLP
rw |
IREN
rw |
EIE
rw |
Bit 0: Error interrupt enable Error Interrupt Enable Bit is required to enable interrupt generation in case of a framing error, overrun error noise flag or SPI slave underrun error (FEÂ =Â 1 or OREÂ =Â 1 or NEÂ =Â 1 or UDR = 1 in the USART_ISR register)..
Allowed values:
0x0: B_0x0: Interrupt inhibited
0x1: B_0x1: interrupt generated when FE = 1 or ORE = 1 or NE = 1 or UDR = 1 (in SPI slave mode) in the USART_ISR register.
Bit 1: IrDA mode enable This bit is set and cleared by software. This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If IrDA mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: IrDA disabled
0x1: B_0x1: IrDA enabled
Bit 2: IrDA low-power This bit is used for selecting between normal and low-power IrDA modes This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If IrDA mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Normal mode
0x1: B_0x1: Low-power mode
Bit 4: Smartcard NACK enable This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If the USART does not support Smartcard mode, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: NACK transmission in case of parity error is disabled
0x1: B_0x1: NACK transmission during parity error is enabled
Bit 5: Smartcard mode enable This bit is used for enabling Smartcard mode. This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If the USART does not support Smartcard mode, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Smartcard Mode disabled
0x1: B_0x1: Smartcard Mode enabled
Bit 8: RTS enable This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If the hardware flow control feature is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: RTS hardware flow control disabled
0x1: B_0x1: RTS output enabled, data is only requested when there is space in the receive buffer. The transmission of data is expected to cease after the current character has been transmitted. The nRTS output is asserted (pulled to 0) when data can be received.
Bit 9: CTS enable This bit can only be written when the USART is disabled (UEÂ =Â 0) Note: If the hardware flow control feature is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: CTS hardware flow control disabled
0x1: B_0x1: CTS mode enabled, data is only transmitted when the nCTS input is asserted (tied to 0). If the nCTS input is deasserted while data is being transmitted, then the transmission is completed before stopping. If data is written into the data register while nCTS is asserted, the transmission is postponed until nCTS is asserted.
Bit 11: One sample bit method enable This bit enables the user to select the sample method. When the one sample bit method is selected the noise detection flag (NE) is disabled. This bit can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: Three sample bit method
0x1: B_0x1: One sample bit method
Bit 12: Overrun Disable This bit is used to disable the receive overrun detection. the ORE flag is not set and the new received data overwrites the previous content of the USART_RDR register. When FIFO mode is enabled, the RXFIFO is bypassed and data is written directly in USART_RDR register. Even when FIFO management is enabled, the RXNE flag is to be used. This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: This control bit enables checking the communication flow w/o reading the data.
Allowed values:
0x0: B_0x0: Overrun Error Flag, ORE, is set when received data is not read before receiving new data.
0x1: B_0x1: Overrun functionality is disabled. If new data is received while the RXNE flag is still set
Bit 13: DMA Disable on Reception Error This bit can only be written when the USART is disabled (UE=0). Note: The reception errors are: parity error, framing error or noise error..
Allowed values:
0x0: B_0x0: DMA is not disabled in case of reception error. The corresponding error flag is set but RXNE is kept 0 preventing from overrun. As a consequence, the DMA request is not asserted, so the erroneous data is not transferred (no DMA request), but next correct received data is transferred (used for Smartcard mode).
0x1: B_0x1: DMA is disabled following a reception error. The corresponding error flag is set, as well as RXNE. The DMA request is masked until the error flag is cleared. This means that the software must first disable the DMA request (DMAR = 0) or clear RXNE/RXFNE is case FIFO mode is enabled) before clearing the error flag.
Bit 14: Driver enable mode This bit enables the user to activate the external transceiver control, through the DE signal. This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If the Driver Enable feature is not supported, this bit is reserved and must be kept at reset value. ..
Allowed values:
0x0: B_0x0: DE function is disabled.
0x1: B_0x1: DE function is enabled. The DE signal is output on the RTS pin.
Bit 15: Driver enable polarity selection This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If the Driver Enable feature is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: DE signal is active high.
0x1: B_0x1: DE signal is active low.
Bits 17-19: Smartcard auto-retry count This bitfield specifies the number of retries for transmission and reception in Smartcard mode. In transmission mode, it specifies the number of automatic retransmission retries, before generating a transmission error (FE bit set). In reception mode, it specifies the number or erroneous reception trials, before generating a reception error (RXNE/RXFNE and PE bits set). This bitfield must be programmed only when the USART is disabled (UEÂ =Â 0). When the USART is enabled (UEÂ =Â 1), this bitfield may only be written to 0x0, in order to stop retransmission. Note: If Smartcard mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: retransmission disabled - No automatic retransmission in transmit mode.
0x1: B_0x1: number of automatic retransmission attempts (before signaling error)
0x2: B_0x2: number of automatic retransmission attempts (before signaling error)
0x3: B_0x3: number of automatic retransmission attempts (before signaling error)
0x4: B_0x4: number of automatic retransmission attempts (before signaling error)
0x5: B_0x5: number of automatic retransmission attempts (before signaling error)
0x6: B_0x6: number of automatic retransmission attempts (before signaling error)
0x7: B_0x7: number of automatic retransmission attempts (before signaling error)
Bits 20-21: Wakeup from low-power mode interrupt flag selection This bitfield specifies the event which activates the WUF (Wakeup from low-power mode flag). This bitfield can only be written when the USART is disabled (UE = 0). If the USART does not support the wakeup from Stop feature, this bit is reserved and must be kept at reset value. Refer to page 835..
Allowed values:
0x0: B_0x0: WUF active on address match (as defined by ADD[7:0] and ADDM7)
0x2: B_0x2: WUF active on start bit detection
0x3: B_0x3: WUF active on RXNE/RXFNE.
Bit 22: Wakeup from low-power mode interrupt enable This bit is set and cleared by software. Note: WUFIE must be set before entering in low-power mode. If the USART does not support the wakeup from Stop feature, this bit is reserved and must be kept at reset value. Refer to page 835..
Allowed values:
0x0: B_0x0: Interrupt inhibited
0x1: B_0x1: USART interrupt generated whenever WUF = 1 in the USART_ISR register
Bit 24: Transmission Complete before guard time, interrupt enable This bit is set and cleared by software. Note: If the USART does not support the Smartcard mode, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Interrupt inhibited
0x1: B_0x1: USART interrupt generated whenever TCBGT=1 in the USART_ISR register
Bits 25-27: Receive FIFO threshold configuration Remaining combinations: Reserved.
Allowed values:
0x0: B_0x0: Receive FIFO reaches 1/8 of its depth
0x1: B_0x1: Receive FIFO reaches 1/4 of its depth
0x2: B_0x2: Receive FIFO reaches 1/2 of its depth
0x3: B_0x3: Receive FIFO reaches 3/4 of its depth
0x4: B_0x4: Receive FIFO reaches 7/8 of its depth
0x5: B_0x5: Receive FIFO becomes full
Bits 29-31: TXFIFO threshold configuration Remaining combinations: Reserved.
Allowed values:
0x0: B_0x0: TXFIFO reaches 1/8 of its depth
0x1: B_0x1: TXFIFO reaches 1/4 of its depth
0x2: B_0x2: TXFIFO reaches 1/2 of its depth
0x3: B_0x3: TXFIFO reaches 3/4 of its depth
0x4: B_0x4: TXFIFO reaches 7/8 of its depth
0x5: B_0x5: TXFIFO becomes empty
Baud rate register
Offset: 0xC, reset: 0x0000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
BRR
rw |
|||||||||||||||
Guard time and prescaler register
Offset: 0x10, reset: 0x0000, access: read-write
1/2 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
GT
rw |
PSC
rw |
||||||||||||||
Bits 0-7: Prescaler value In IrDA low-power and normal IrDA mode: PSC[7:0] = IrDA Normal and Low-Power baud rate PSC[7:0] is used to program the prescaler for dividing the USART source clock to achieve the low-power frequency: the source clock is divided by the value given in the register (8 significant bits): In Smartcard mode: PSC[4:0]Â =Â Prescaler value PSC[4:0] is used to program the prescaler for dividing the USART source clock to provide the Smartcard clock. The value given in the register (5 significant bits) is multiplied by 2 to give the division factor of the source clock frequency: ... 0010Â 0000: Divides the source clock by 32 (IrDA mode) ... 1111Â 1111: Divides the source clock by 255 (IrDA mode) This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: Bits [7:5] must be kept cleared if Smartcard mode is used. This bitfield is reserved and forced by hardware to '0â when the Smartcard and IrDA modes are not supported. Refer to ..
Allowed values:
0x0: B_0x0: Reserved - do not program this value
0x1: B_0x1: Divides the source clock by 1 (IrDA mode) / by 2 (Smarcard mode)
0x2: B_0x2: Divides the source clock by 2 (IrDA mode) / by 4 (Smartcard mode)
0x3: B_0x3: Divides the source clock by 3 (IrDA mode) / by 6 (Smartcard mode)
0x1F: B_0x1F: Divides the source clock by 31 (IrDA mode) / by 62 (Smartcard mode)
Bits 8-15: Guard time value This bitfield is used to program the Guard time value in terms of number of baud clock periods. This is used in Smartcard mode. The Transmission Complete flag is set after this guard time value. This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If Smartcard mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Receiver timeout register
Offset: 0x14, reset: 0x0000, access: read-write
0/2 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
BLEN
rw |
RTO
rw |
||||||||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
RTO
rw |
|||||||||||||||
Request register
Offset: 0x18, reset: 0x0000, access: write-only
0/5 fields covered.
Bit 0: Auto baud rate request Writing 1 to this bit resets the ABRF flag in the USART_ISR and requests an automatic baud rate measurement on the next received data frame. Note: If the USART does not support the auto baud rate feature, this bit is reserved and must be kept at reset value. Refer to ..
Bit 1: Send break request Writing 1 to this bit sets the SBKF flag and request to send a BREAK on the line, as soon as the transmit machine is available. Note: When the application needs to send the break character following all previously inserted data, including the ones not yet transmitted, the software should wait for the TXE flag assertion before setting the SBKRQ bit..
Bit 4: Transmit data flush request When FIFO mode is disabled, writing '1â to this bit sets the TXE flag. This enables to discard the transmit data. This bit must be used only in Smartcard mode, when data have not been sent due to errors (NACK) and the FE flag is active in the USART_ISR register. If the USART does not support Smartcard mode, this bit is reserved and must be kept at reset value. When FIFO is enabled, TXFRQ bit is set to flush the whole FIFO. This sets the TXFE flag (Transmit FIFO empty, bit 23 in the USART_ISR register). Flushing the Transmit FIFO is supported in both UART and Smartcard modes. Note: In FIFO mode, the TXFNF flag is reset during the flush request until TxFIFO is empty in order to ensure that no data are written in the data register..
Interrupt & status register
Offset: 0x1C, reset: 0x000000C0, access: read-only
24/24 fields covered.
Bit 0: Parity error This bit is set by hardware when a parity error occurs in receiver mode. It is cleared by software, writing 1 to the PECF in the USART_ICR register. An interrupt is generated if PEIE = 1 in the USART_CR1 register..
Allowed values:
0x0: B_0x0: No parity error
0x1: B_0x1: Parity error
Bit 1: Framing error This bit is set by hardware when a de-synchronization, excessive noise or a break character is detected. It is cleared by software, writing 1 to the FECF bit in the USART_ICR register. When transmitting data in Smartcard mode, this bit is set when the maximum number of transmit attempts is reached without success (the card NACKs the data frame). An interrupt is generated if EIEÂ =Â 1 in the USART_CR1 register..
Allowed values:
0x0: B_0x0: No Framing error is detected
0x1: B_0x1: Framing error or break character is detected
Bit 2: Noise detection flag This bit is set by hardware when noise is detected on a received frame. It is cleared by software, writing 1 to the NECF bit in the USART_ICR register. Note: This bit does not generate an interrupt as it appears at the same time as the RXNE bit which itself generates an interrupt. An interrupt is generated when the NE flag is set during multi buffer communication if the EIE bit is set. When the line is noise-free, the NE flag can be disabled by programming the ONEBIT bit to 1 to increase the USART tolerance to deviations (Refer to Tolerance of the USART receiver to clock deviation on page 861)..
Allowed values:
0x0: B_0x0: No noise is detected
0x1: B_0x1: Noise is detected
Bit 3: Overrun error This bit is set by hardware when the data currently being received in the shift register is ready to be transferred into the USART_RDR register while RXNEÂ =Â 1. It is cleared by a software, writing 1 to the ORECF, in the USART_ICR register. An interrupt is generated if RXNEIEÂ =Â 1 or EIE Â =Â 1 in the USART_CR1 register. Note: When this bit is set, the USART_RDR register content is not lost but the shift register is overwritten. An interrupt is generated if the ORE flag is set during multi buffer communication if the EIE bit is set. This bit is permanently forced to 0 (no overrun detection) when the bit OVRDIS is set in the USART_CR3 register..
Allowed values:
0x0: B_0x0: No overrun error
0x1: B_0x1: Overrun error is detected
Bit 4: Idle line detected This bit is set by hardware when an Idle Line is detected. An interrupt is generated if IDLEIEÂ =Â 1 in the USART_CR1 register. It is cleared by software, writing 1 to the IDLECF in the USART_ICR register. Note: The IDLE bit is not set again until the RXNE bit has been set (i.e. a new idle line occurs). If Mute mode is enabled (MMEÂ =Â 1), IDLE is set if the USART is not mute (RWUÂ =Â 0), whatever the Mute mode selected by the WAKE bit. If RWUÂ =Â 1, IDLE is not set..
Allowed values:
0x0: B_0x0: No Idle line is detected
0x1: B_0x1: Idle line is detected
Bit 5: Read data register not empty RXNE bit is set by hardware when the content of the USART_RDR shift register has been transferred to the USART_RDR register. It is cleared by reading from the USART_RDR register. The RXNE flag can also be cleared by writing 1 to the RXFRQ in the USART_RQR register. An interrupt is generated if RXNEIEÂ =Â 1 in the USART_CR1 register..
Allowed values:
0x0: B_0x0: Data is not received
0x1: B_0x1: Received data is ready to be read.
Bit 6: Transmission complete This bit indicates that the last data written in the USART_TDR has been transmitted out of the shift register. It is set by hardware when the transmission of a frame containing data is complete and when TXE is set. An interrupt is generated if TCIEÂ =Â 1 in the USART_CR1 register. TC bit is is cleared by software, by writing 1 to the TCCF in the USART_ICR register or by a write to the USART_TDR register. Note: If TE bit is reset and no transmission is on going, the TC bit is set immediately..
Allowed values:
0x0: B_0x0: Transmission is not complete
0x1: B_0x1: Transmission is complete
Bit 7: Transmit data register empty TXE is set by hardware when the content of the USART_TDR register has been transferred into the shift register. It is cleared by writing to the USART_TDR register. The TXE flag can also be set by writing 1 to the TXFRQ in the USART_RQR register, in order to discard the data (only in Smartcard T = 0 mode, in case of transmission failure). An interrupt is generated if the TXEIE bit  = 1 in the USART_CR1 register..
Allowed values:
0x0: B_0x0: Data register full
0x1: B_0x1: Data register not full
Bit 8: LIN break detection flag This bit is set by hardware when the LIN break is detected. It is cleared by software, by writing 1 to the LBDCF in the USART_ICR. An interrupt is generated if LBDIE = 1 in the USART_CR2 register. Note: If the USART does not support LIN mode, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: LIN Break not detected
0x1: B_0x1: LIN break detected
Bit 9: CTS interrupt flag This bit is set by hardware when the nCTS input toggles, if the CTSE bit is set. It is cleared by software, by writing 1 to the CTSCF bit in the USART_ICR register. An interrupt is generated if CTSIEÂ =Â 1 in the USART_CR3 register. Note: If the hardware flow control feature is not supported, this bit is reserved and kept at reset value..
Allowed values:
0x0: B_0x0: No change occurred on the nCTS status line
0x1: B_0x1: A change occurred on the nCTS status line
Bit 11: Receiver timeout This bit is set by hardware when the timeout value, programmed in the RTOR register has lapsed, without any communication. It is cleared by software, writing 1 to the RTOCF bit in the USART_ICR register. An interrupt is generated if RTOIEÂ =Â 1 in the USART_CR2 register. In Smartcard mode, the timeout corresponds to the CWT or BWT timings. Note: If a time equal to the value programmed in RTOR register separates 2 characters, RTOF is not set. If this time exceeds this value + 2 sample times (2/16 or 2/8, depending on the oversampling method), RTOF flag is set. The counter counts even if RE = 0 but RTOF is set only when RE = 1. If the timeout has already elapsed when RE is set, then RTOF is set. If the USART does not support the Receiver timeout feature, this bit is reserved and kept at reset value..
Allowed values:
0x0: B_0x0: Timeout value not reached
0x1: B_0x1: Timeout value reached without any data reception
Bit 12: End of block flag This bit is set by hardware when a complete block has been received (for example TÂ =Â 1 Smartcard mode). The detection is done when the number of received bytes (from the start of the block, including the prologue) is equal or greater than BLEN + 4. An interrupt is generated if the EOBIEÂ =Â 1 in the USART_CR2 register. It is cleared by software, writing 1 to the EOBCF in the USART_ICR register. Note: If Smartcard mode is not supported, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: End of Block not reached
0x1: B_0x1: End of Block (number of characters) reached
Bit 13: SPI slave underrun error flag In slave transmission mode, this flag is set when the first clock pulse for data transmission appears while the software has not yet loaded any value into USART_TDR. This flag is reset by setting UDRCF bit in the USART_ICR register. Note: If the USART does not support the SPI slave mode, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: No underrun error
0x1: B_0x1: underrun error
Bit 14: Auto baud rate error This bit is set by hardware if the baud rate measurement failed (baud rate out of range or character comparison failed) It is cleared by software, by writing 1 to the ABRRQ bit in the USART_CR3 register. Note: If the USART does not support the auto baud rate feature, this bit is reserved and kept at reset value..
Bit 15: Auto baud rate flag This bit is set by hardware when the automatic baud rate has been set (RXNE is also set, generating an interrupt if RXNEIE = 1) or when the auto baud rate operation was completed without success (ABREÂ =Â 1) (ABRE, RXNE and FE are also set in this case) It is cleared by software, in order to request a new auto baud rate detection, by writing 1 to the ABRRQ in the USART_RQR register. Note: If the USART does not support the auto baud rate feature, this bit is reserved and kept at reset value..
Bit 16: Busy flag This bit is set and reset by hardware. It is active when a communication is ongoing on the RX line (successful start bit detected). It is reset at the end of the reception (successful or not)..
Allowed values:
0x0: B_0x0: USART is idle (no reception)
0x1: B_0x1: Reception on going
Bit 17: Character match flag This bit is set by hardware, when a the character defined by ADD[7:0] is received. It is cleared by software, writing 1 to the CMCF in the USART_ICR register. An interrupt is generated if CMIEÂ =Â 1in the USART_CR1 register..
Allowed values:
0x0: B_0x0: No Character match detected
0x1: B_0x1: Character Match detected
Bit 18: Send break flag This bit indicates that a send break character was requested. It is set by software, by writing 1 to the SBKRQ bit in the USART_CR3 register. It is automatically reset by hardware during the stop bit of break transmission..
Allowed values:
0x0: B_0x0: Break character transmitted
0x1: B_0x1: Break character requested by setting SBKRQ bit in USART_RQR register
Bit 19: Receiver wakeup from Mute mode This bit indicates if the USART is in Mute mode. It is cleared/set by hardware when a wakeup/mute sequence is recognized. The Mute mode control sequence (address or IDLE) is selected by the WAKE bit in the USART_CR1 register. When wakeup on IDLE mode is selected, this bit can only be set by software, writing 1 to the MMRQ bit in the USART_RQR register. Note: If the USART does not support the wakeup from Stop feature, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Receiver in active mode
0x1: B_0x1: Receiver in Mute mode
Bit 20: Wakeup from low-power mode flag This bit is set by hardware, when a wakeup event is detected. The event is defined by the WUS bitfield. It is cleared by software, writing a 1 to the WUCF in the USART_ICR register. An interrupt is generated if WUFIEÂ =Â 1 in the USART_CR3 register. Note: When UESM is cleared, WUF flag is also cleared. If the USART does not support the wakeup from Stop feature, this bit is reserved and kept at reset value. Refer to ..
Bit 21: Transmit enable acknowledge flag This bit is set/reset by hardware, when the Transmit Enable value is taken into account by the USART. It can be used when an idle frame request is generated by writing TEÂ =Â 0, followed by TEÂ =Â 1 in the USART_CR1 register, in order to respect the TEÂ =Â 0 minimum period..
Bit 22: Receive enable acknowledge flag This bit is set/reset by hardware, when the Receive Enable value is taken into account by the USART. It can be used to verify that the USART is ready for reception before entering low-power mode. Note: If the USART does not support the wakeup from Stop feature, this bit is reserved and kept at reset value. Refer to ..
Bit 25: Transmission complete before guard time flag This bit is set when the last data written in the USART_TDR has been transmitted correctly out of the shift register. It is set by hardware in Smartcard mode, if the transmission of a frame containing data is complete and if the smartcard did not send back any NACK. An interrupt is generated if TCBGTIE = 1 in the USART_CR3 register. This bit is cleared by software, by writing 1 to the TCBGTCF in the USART_ICR register or by a write to the USART_TDR register. Note: If the USART does not support the Smartcard mode, this bit is reserved and kept at reset value. If the USART supports the Smartcard mode and the Smartcard mode is enabled, the TCBGT reset value is '1â. Refer to on page 835..
Allowed values:
0x0: B_0x0: Transmission is not complete or transmission is complete unsuccessfully (i.e. a NACK is received from the card)
0x1: B_0x1: Transmission is complete successfully (before Guard time completion and there is no NACK from the smart card).
Interrupt & status register
Offset: 0x1C, reset: 0x008000C0, access: read-only
28/28 fields covered.
Bit 0: Parity error This bit is set by hardware when a parity error occurs in receiver mode. It is cleared by software, writing 1 to the PECF in the USART_ICR register. An interrupt is generated if PEIE = 1 in the USART_CR1 register. Note: This error is associated with the character in the USART_RDR..
Allowed values:
0x0: B_0x0: No parity error
0x1: B_0x1: Parity error
Bit 1: Framing error This bit is set by hardware when a de-synchronization, excessive noise or a break character is detected. It is cleared by software, writing 1 to the FECF bit in the USART_ICR register. When transmitting data in Smartcard mode, this bit is set when the maximum number of transmit attempts is reached without success (the card NACKs the data frame). An interrupt is generated if EIEÂ =Â 1 in the USART_CR1 register. Note: This error is associated with the character in the USART_RDR..
Allowed values:
0x0: B_0x0: No Framing error is detected
0x1: B_0x1: Framing error or break character is detected
Bit 2: Noise detection flag This bit is set by hardware when noise is detected on a received frame. It is cleared by software, writing 1 to the NECF bit in the USART_ICR register. Note: This bit does not generate an interrupt as it appears at the same time as the RXFNE bit which itself generates an interrupt. An interrupt is generated when the NE flag is set during multi buffer communication if the EIE bit is set. When the line is noise-free, the NE flag can be disabled by programming the ONEBIT bit to 1 to increase the USART tolerance to deviations (Refer to Tolerance of the USART receiver to clock deviation on page 861). This error is associated with the character in the USART_RDR..
Allowed values:
0x0: B_0x0: No noise is detected
0x1: B_0x1: Noise is detected
Bit 3: Overrun error This bit is set by hardware when the data currently being received in the shift register is ready to be transferred into the USART_RDR register while RXFF = 1. It is cleared by a software, writing 1 to the ORECF, in the USART_ICR register. An interrupt is generated if RXFNEIEÂ =Â 1 or EIE = 1 in the USART_CR1 register. Note: When this bit is set, the USART_RDR register content is not lost but the shift register is overwritten. An interrupt is generated if the ORE flag is set during multi buffer communication if the EIE bit is set. This bit is permanently forced to 0 (no overrun detection) when the bit OVRDIS is set in the USART_CR3 register..
Allowed values:
0x0: B_0x0: No overrun error
0x1: B_0x1: Overrun error is detected
Bit 4: Idle line detected This bit is set by hardware when an Idle Line is detected. An interrupt is generated if IDLEIEÂ =Â 1 in the USART_CR1 register. It is cleared by software, writing 1 to the IDLECF in the USART_ICR register. Note: The IDLE bit is not set again until the RXFNE bit has been set (i.e. a new idle line occurs). If Mute mode is enabled (MMEÂ =Â 1), IDLE is set if the USART is not mute (RWUÂ =Â 0), whatever the Mute mode selected by the WAKE bit. If RWUÂ =Â 1, IDLE is not set..
Allowed values:
0x0: B_0x0: No Idle line is detected
0x1: B_0x1: Idle line is detected
Bit 5: RXFIFO not empty RXFNE bit is set by hardware when the RXFIFO is not empty, meaning that data can be read from the USART_RDR register. Every read operation from the USART_RDR frees a location in the RXFIFO. RXFNE is cleared when the RXFIFO is empty. The RXFNE flag can also be cleared by writing 1 to the RXFRQ in the USART_RQR register. An interrupt is generated if RXFNEIEÂ =Â 1 in the USART_CR1 register..
Allowed values:
0x0: B_0x0: Data is not received
0x1: B_0x1: Received data is ready to be read.
Bit 6: Transmission complete This bit indicates that the last data written in the USART_TDR has been transmitted out of the shift register. It is set by hardware when the transmission of a frame containing data is complete and when TXFE is set. An interrupt is generated if TCIEÂ =Â 1 in the USART_CR1 register. TC bit is is cleared by software, by writing 1 to the TCCF in the USART_ICR register or by a write to the USART_TDR register. Note: If TE bit is reset and no transmission is on going, the TC bit is immediately set..
Allowed values:
0x0: B_0x0: Transmission is not complete
0x1: B_0x1: Transmission is complete
Bit 7: TXFIFO not full TXFNF is set by hardware when TXFIFO is not full meaning that data can be written in the USART_TDR. Every write operation to the USART_TDR places the data in the TXFIFO. This flag remains set until the TXFIFO is full. When the TXFIFO is full, this flag is cleared indicating that data can not be written into the USART_TDR. An interrupt is generated if the TXFNFIE bit =1 in the USART_CR1 register. Note: The TXFNF is kept reset during the flush request until TXFIFO is empty. After sending the flush request (by setting TXFRQ bit), the flag TXFNF should be checked prior to writing in TXFIFO (TXFNF and TXFE are set at the same time). This bit is used during single buffer transmission..
Allowed values:
0x0: B_0x0: Transmit FIFO is full
0x1: B_0x1: Transmit FIFO is not full
Bit 8: LIN break detection flag This bit is set by hardware when the LIN break is detected. It is cleared by software, by writing 1 to the LBDCF in the USART_ICR. An interrupt is generated if LBDIE = 1 in the USART_CR2 register. Note: If the USART does not support LIN mode, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: LIN Break not detected
0x1: B_0x1: LIN break detected
Bit 9: CTS interrupt flag This bit is set by hardware when the nCTS input toggles, if the CTSE bit is set. It is cleared by software, by writing 1 to the CTSCF bit in the USART_ICR register. An interrupt is generated if CTSIEÂ =Â 1 in the USART_CR3 register. Note: If the hardware flow control feature is not supported, this bit is reserved and kept at reset value..
Allowed values:
0x0: B_0x0: No change occurred on the nCTS status line
0x1: B_0x1: A change occurred on the nCTS status line
Bit 11: Receiver timeout This bit is set by hardware when the timeout value, programmed in the RTOR register has lapsed, without any communication. It is cleared by software, writing 1 to the RTOCF bit in the USART_ICR register. An interrupt is generated if RTOIEÂ =Â 1 in the USART_CR2 register. In Smartcard mode, the timeout corresponds to the CWT or BWT timings. Note: If a time equal to the value programmed in RTOR register separates 2 characters, RTOF is not set. If this time exceeds this value + 2 sample times (2/16 or 2/8, depending on the oversampling method), RTOF flag is set. The counter counts even if RE = 0 but RTOF is set only when RE = 1. If the timeout has already elapsed when RE is set, then RTOF is set. If the USART does not support the Receiver timeout feature, this bit is reserved and kept at reset value..
Allowed values:
0x0: B_0x0: Timeout value not reached
0x1: B_0x1: Timeout value reached without any data reception
Bit 12: End of block flag This bit is set by hardware when a complete block has been received (for example TÂ =Â 1 Smartcard mode). The detection is done when the number of received bytes (from the start of the block, including the prologue) is equal or greater than BLEN + 4. An interrupt is generated if the EOBIEÂ =Â 1 in the USART_CR2 register. It is cleared by software, writing 1 to the EOBCF in the USART_ICR register. Note: If Smartcard mode is not supported, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: End of Block not reached
0x1: B_0x1: End of Block (number of characters) reached
Bit 13: SPI slave underrun error flag In slave transmission mode, this flag is set when the first clock pulse for data transmission appears while the software has not yet loaded any value into USART_TDR. This flag is reset by setting UDRCF bit in the USART_ICR register. Note: If the USART does not support the SPI slave mode, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: No underrun error
0x1: B_0x1: underrun error
Bit 14: Auto baud rate error This bit is set by hardware if the baud rate measurement failed (baud rate out of range or character comparison failed) It is cleared by software, by writing 1 to the ABRRQ bit in the USART_CR3 register. Note: If the USART does not support the auto baud rate feature, this bit is reserved and kept at reset value..
Bit 15: Auto baud rate flag This bit is set by hardware when the automatic baud rate has been set (RXFNE is also set, generating an interrupt if RXFNEIE = 1) or when the auto baud rate operation was completed without success (ABREÂ =Â 1) (ABRE, RXFNE and FE are also set in this case) It is cleared by software, in order to request a new auto baud rate detection, by writing 1 to the ABRRQ in the USART_RQR register. Note: If the USART does not support the auto baud rate feature, this bit is reserved and kept at reset value..
Bit 16: Busy flag This bit is set and reset by hardware. It is active when a communication is ongoing on the RX line (successful start bit detected). It is reset at the end of the reception (successful or not)..
Allowed values:
0x0: B_0x0: USART is idle (no reception)
0x1: B_0x1: Reception on going
Bit 17: Character match flag This bit is set by hardware, when a the character defined by ADD[7:0] is received. It is cleared by software, writing 1 to the CMCF in the USART_ICR register. An interrupt is generated if CMIEÂ =Â 1in the USART_CR1 register..
Allowed values:
0x0: B_0x0: No Character match detected
0x1: B_0x1: Character Match detected
Bit 18: Send break flag This bit indicates that a send break character was requested. It is set by software, by writing 1 to the SBKRQ bit in the USART_CR3 register. It is automatically reset by hardware during the stop bit of break transmission..
Allowed values:
0x0: B_0x0: Break character transmitted
0x1: B_0x1: Break character requested by setting SBKRQ bit in USART_RQR register
Bit 19: Receiver wakeup from Mute mode This bit indicates if the USART is in Mute mode. It is cleared/set by hardware when a wakeup/mute sequence is recognized. The Mute mode control sequence (address or IDLE) is selected by the WAKE bit in the USART_CR1 register. When wakeup on IDLE mode is selected, this bit can only be set by software, writing 1 to the MMRQ bit in the USART_RQR register. Note: If the USART does not support the wakeup from Stop feature, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Receiver in active mode
0x1: B_0x1: Receiver in Mute mode
Bit 20: Wakeup from low-power mode flag This bit is set by hardware, when a wakeup event is detected. The event is defined by the WUS bitfield. It is cleared by software, writing a 1 to the WUCF in the USART_ICR register. An interrupt is generated if WUFIEÂ =Â 1 in the USART_CR3 register. Note: When UESM is cleared, WUF flag is also cleared. If the USART does not support the wakeup from Stop feature, this bit is reserved and kept at reset value. Refer to ..
Bit 21: Transmit enable acknowledge flag This bit is set/reset by hardware, when the Transmit Enable value is taken into account by the USART. It can be used when an idle frame request is generated by writing TEÂ =Â 0, followed by TEÂ =Â 1 in the USART_CR1 register, in order to respect the TEÂ =Â 0 minimum period..
Bit 22: Receive enable acknowledge flag This bit is set/reset by hardware, when the Receive Enable value is taken into account by the USART. It can be used to verify that the USART is ready for reception before entering low-power mode. Note: If the USART does not support the wakeup from Stop feature, this bit is reserved and kept at reset value. Refer to ..
Bit 23: TXFIFO empty This bit is set by hardware when TXFIFO is empty. When the TXFIFO contains at least one data, this flag is cleared. The TXFE flag can also be set by writing 1 to the bit TXFRQ (bit 4) in the USART_RQR register. An interrupt is generated if the TXFEIE bit  = 1 (bit 30) in the USART_CR1 register..
Allowed values:
0x0: B_0x0: TXFIFO not empty.
0x1: B_0x1: TXFIFO empty.
Bit 24: RXFIFO full This bit is set by hardware when the number of received data corresponds to RXFIFO size + 1 (RXFIFO full + 1 data in the USART_RDR register. An interrupt is generated if the RXFFIE bit  = 1 in the USART_CR1 register..
Allowed values:
0x0: B_0x0: RXFIFO not full.
0x1: B_0x1: RXFIFO Full.
Bit 25: Transmission complete before guard time flag This bit is set when the last data written in the USART_TDR has been transmitted correctly out of the shift register. It is set by hardware in Smartcard mode, if the transmission of a frame containing data is complete and if the smartcard did not send back any NACK. An interrupt is generated if TCBGTIE = 1 in the USART_CR3 register. This bit is cleared by software, by writing 1 to the TCBGTCF in the USART_ICR register or by a write to the USART_TDR register. Note: If the USART does not support the Smartcard mode, this bit is reserved and kept at reset value. If the USART supports the Smartcard mode and the Smartcard mode is enabled, the TCBGT reset value is '1â. Refer to on page 835..
Allowed values:
0x0: B_0x0: Transmission is not complete or transmission is complete unsuccessfully (i.e. a NACK is received from the card)
0x1: B_0x1: Transmission is complete successfully (before Guard time completion and there is no NACK from the smart card).
Bit 26: RXFIFO threshold flag This bit is set by hardware when the threshold programmed in RXFTCFG in USART_CR3 register is reached. This means that there are (RXFTCFG - 1) data in the Receive FIFO and one data in the USART_RDR register. An interrupt is generated if the RXFTIE bit  = 1 (bit 27) in the USART_CR3 register. Note: When the RXFTCFG threshold is configured to '101â, RXFT flag is set if 16 data are available i.e. 15 data in the RXFIFO and 1 data in the USART_RDR. Consequently, the 17th received data does not cause an overrun error. The overrun error occurs after receiving the 18th data..
Allowed values:
0x0: B_0x0: Receive FIFO does not reach the programmed threshold.
0x1: B_0x1: Receive FIFO reached the programmed threshold.
Bit 27: TXFIFO threshold flag This bit is set by hardware when the TXFIFO reaches the threshold programmed in TXFTCFG of USART_CR3 register i.e. the TXFIFO contains TXFTCFG empty locations. An interrupt is generated if the TXFTIE bit  = 1 (bit 31) in the USART_CR3 register..
Allowed values:
0x0: B_0x0: TXFIFO does not reach the programmed threshold.
0x1: B_0x1: TXFIFO reached the programmed threshold.
Receive data register
Offset: 0x24, reset: 0x0000, access: read-only
1/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
RDR
r |
|||||||||||||||
Transmit data register
Offset: 0x28, reset: 0x0000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
TDR
rw |
|||||||||||||||
Prescaler register
Offset: 0x2C, reset: 0x0000, access: read-write
1/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
PRESCALER
rw |
|||||||||||||||
Bits 0-3: Clock prescaler The USART input clock can be divided by a prescaler factor: Remaining combinations: Reserved Note: When PRESCALER is programmed with a value different of the allowed ones, programmed prescaler value is 1011 i.e. input clock divided by 256..
Allowed values:
0x0: B_0x0: input clock not divided
0x1: B_0x1: input clock divided by 2
0x2: B_0x2: input clock divided by 4
0x3: B_0x3: input clock divided by 6
0x4: B_0x4: input clock divided by 8
0x5: B_0x5: input clock divided by 10
0x6: B_0x6: input clock divided by 12
0x7: B_0x7: input clock divided by 16
0x8: B_0x8: input clock divided by 32
0x9: B_0x9: input clock divided by 64
0xA: B_0xA: input clock divided by 128
0xB: B_0xB: input clock divided by 256
0x40004400: Universal synchronous asynchronous receiver transmitter
136/170 fields covered. Toggle Registers
| Offset | Name | 31 |
30 |
29 |
28 |
27 |
26 |
25 |
24 |
23 |
22 |
21 |
20 |
19 |
18 |
17 |
16 |
15 |
14 |
13 |
12 |
11 |
10 |
9 |
8 |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x0 | CR1_FIFO_DISABLED | ||||||||||||||||||||||||||||||||
| 0x0 | CR1_FIFO_ENABLED | ||||||||||||||||||||||||||||||||
| 0x4 | CR2 | ||||||||||||||||||||||||||||||||
| 0x8 | CR3 | ||||||||||||||||||||||||||||||||
| 0xC | BRR | ||||||||||||||||||||||||||||||||
| 0x10 | GTPR | ||||||||||||||||||||||||||||||||
| 0x14 | RTOR | ||||||||||||||||||||||||||||||||
| 0x18 | RQR | ||||||||||||||||||||||||||||||||
| 0x1C | ISR_FIFO_DISABLED | ||||||||||||||||||||||||||||||||
| 0x1C | ISR_FIFO_ENABLED | ||||||||||||||||||||||||||||||||
| 0x20 | ICR | ||||||||||||||||||||||||||||||||
| 0x24 | RDR | ||||||||||||||||||||||||||||||||
| 0x28 | TDR | ||||||||||||||||||||||||||||||||
| 0x2C | PRESC | ||||||||||||||||||||||||||||||||
Control register 1
Offset: 0x0, reset: 0x0000, access: read-write
18/22 fields covered.
Bit 0: USART enable When this bit is cleared, the USART prescalers and outputs are stopped immediately, and all current operations are discarded. The USART configuration is kept, but all the USART_ISR status flags are reset. This bit is set and cleared by software. Note: To enter low-power mode without generating errors on the line, the TE bit must be previously reset and the software must wait for the TC bit in the USART_ISR to be set before resetting the UE bit. The DMA requests are also reset when UE = 0 so the DMA channel must be disabled before resetting the UE bit. In Smartcard mode, (SCEN = 1), the SCLK is always available when CLKEN = 1, regardless of the UE bit value..
Allowed values:
0x0: B_0x0: USART prescaler and outputs disabled, low-power mode
0x1: B_0x1: USART enabled
Bit 1: USART enable in low-power mode When this bit is cleared, the USART cannot wake up the MCU from low-power mode. When this bit is set, the USART can wake up the MCU from low-power mode. This bit is set and cleared by software. Note: It is recommended to set the UESM bit just before entering low-power mode and clear it when exit from low-power mode. If the USART does not support the wakeup from Stop feature, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: USART not able to wake up the MCU from low-power mode.
0x1: B_0x1: USART able to wake up the MCU from low-power mode.
Bit 3: Transmitter enable This bit enables the transmitter. It is set and cleared by software. Note: During transmission, a low pulse on the TE bit ('0â followed by '1â) sends a preamble (idle line) after the current word, except in Smartcard mode. In order to generate an idle character, the TE must not be immediately written to '1â. To ensure the required duration, the software can poll the TEACK bit in the USART_ISR register. In Smartcard mode, when TE is set, there is a 1 bit-time delay before the transmission starts..
Allowed values:
0x0: B_0x0: Transmitter is disabled
0x1: B_0x1: Transmitter is enabled
Bit 9: Parity selection This bit selects the odd or even parity when the parity generation/detection is enabled (PCE bit set). It is set and cleared by software. The parity is selected after the current byte. This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: Even parity
0x1: B_0x1: Odd parity
Bit 10: Parity control enable This bit selects the hardware parity control (generation and detection). When the parity control is enabled, the computed parity is inserted at the MSB position (9th bit if MÂ =Â 1; 8th bit if MÂ =Â 0) and the parity is checked on the received data. This bit is set and cleared by software. Once it is set, PCE is active after the current byte (in reception and in transmission). This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: Parity control disabled
0x1: B_0x1: Parity control enabled
Bit 13: Mute mode enable This bit enables the USART Mute mode function. When set, the USART can switch between active and Mute mode, as defined by the WAKE bit. It is set and cleared by software..
Allowed values:
0x0: B_0x0: Receiver in active mode permanently
0x1: B_0x1: Receiver can switch between Mute mode and active mode.
Bits 16-20: Driver Enable deassertion time This 5-bit value defines the time between the end of the last stop bit, in a transmitted message, and the de-activation of the DE (Driver Enable) signal. It is expressed in sample time units (1/8 or 1/16 bit time, depending on the oversampling rate). If the USART_TDR register is written during the DEDT time, the new data is transmitted only when the DEDT and DEAT times have both elapsed. This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If the Driver Enable feature is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Bits 21-25: Driver Enable assertion time This 5-bit value defines the time between the activation of the DE (Driver Enable) signal and the beginning of the start bit. It is expressed in sample time units (1/8 or 1/16 bit time, depending on the oversampling rate). This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If the Driver Enable feature is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Bit 26: Receiver timeout interrupt enable This bit is set and cleared by software. Note: If the USART does not support the Receiver timeout feature, this bit is reserved and must be kept at reset value. ..
Allowed values:
0x0: B_0x0: Interrupt inhibited
0x1: B_0x1: USART interrupt generated when the RTOF bit is set in the USART_ISR register.
Bit 27: End of Block interrupt enable This bit is set and cleared by software. Note: If the USART does not support Smartcard mode, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Interrupt inhibited
0x1: B_0x1: USART interrupt generated when the EOBF flag is set in the USART_ISR register
Bit 28: Word length This bit must be used in conjunction with bit 12 (M0) to determine the word length. It is set or cleared by software. M[1:0] = '00â: 1 start bit, 8 Data bits, n Stop bit M[1:0] = '01â: 1 start bit, 9 Data bits, n Stop bit M[1:0] = '10â: 1 start bit, 7 Data bits, n Stop bit This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: In 7-bits data length mode, the Smartcard mode, LIN master mode and Auto baud rate (0x7F and 0x55 frames detection) are not supported..
Bit 29: FIFO mode enable This bit is set and cleared by software. This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: FIFO mode can be used on standard UART communication, in SPI master/slave mode and in Smartcard modes only. It must not be enabled in IrDA and LIN modes..
Allowed values:
0x0: B_0x0: FIFO mode is disabled.
0x1: B_0x1: FIFO mode is enabled.
Control register 1
Offset: 0x0, reset: 0x0000, access: read-write
20/24 fields covered.
Bit 0: USART enable When this bit is cleared, the USART prescalers and outputs are stopped immediately, and all current operations are discarded. The USART configuration is kept, but all the USART_ISR status flags are reset. This bit is set and cleared by software. Note: To enter low-power mode without generating errors on the line, the TE bit must be previously reset and the software must wait for the TC bit in the USART_ISR to be set before resetting the UE bit. The DMA requests are also reset when UE = 0 so the DMA channel must be disabled before resetting the UE bit. In Smartcard mode, (SCEN = 1), the SCLK is always available when CLKEN = 1, regardless of the UE bit value..
Allowed values:
0x0: B_0x0: USART prescaler and outputs disabled, low-power mode
0x1: B_0x1: USART enabled
Bit 1: USART enable in low-power mode When this bit is cleared, the USART cannot wake up the MCU from low-power mode. When this bit is set, the USART can wake up the MCU from low-power mode. This bit is set and cleared by software. Note: It is recommended to set the UESM bit just before entering low-power mode and clear it when exit from low-power mode. If the USART does not support the wakeup from Stop feature, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: USART not able to wake up the MCU from low-power mode.
0x1: B_0x1: USART able to wake up the MCU from low-power mode.
Bit 3: Transmitter enable This bit enables the transmitter. It is set and cleared by software. Note: During transmission, a low pulse on the TE bit ('0â followed by '1â) sends a preamble (idle line) after the current word, except in Smartcard mode. In order to generate an idle character, the TE must not be immediately written to '1â. To ensure the required duration, the software can poll the TEACK bit in the USART_ISR register. In Smartcard mode, when TE is set, there is a 1 bit-time delay before the transmission starts..
Allowed values:
0x0: B_0x0: Transmitter is disabled
0x1: B_0x1: Transmitter is enabled
Bit 9: Parity selection This bit selects the odd or even parity when the parity generation/detection is enabled (PCE bit set). It is set and cleared by software. The parity is selected after the current byte. This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: Even parity
0x1: B_0x1: Odd parity
Bit 10: Parity control enable This bit selects the hardware parity control (generation and detection). When the parity control is enabled, the computed parity is inserted at the MSB position (9th bit if MÂ =Â 1; 8th bit if MÂ =Â 0) and the parity is checked on the received data. This bit is set and cleared by software. Once it is set, PCE is active after the current byte (in reception and in transmission). This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: Parity control disabled
0x1: B_0x1: Parity control enabled
Bit 13: Mute mode enable This bit enables the USART Mute mode function. When set, the USART can switch between active and Mute mode, as defined by the WAKE bit. It is set and cleared by software..
Allowed values:
0x0: B_0x0: Receiver in active mode permanently
0x1: B_0x1: Receiver can switch between Mute mode and active mode.
Bits 16-20: Driver Enable deassertion time This 5-bit value defines the time between the end of the last stop bit, in a transmitted message, and the de-activation of the DE (Driver Enable) signal. It is expressed in sample time units (1/8 or 1/16 bit time, depending on the oversampling rate). If the USART_TDR register is written during the DEDT time, the new data is transmitted only when the DEDT and DEAT times have both elapsed. This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If the Driver Enable feature is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Bits 21-25: Driver Enable assertion time This 5-bit value defines the time between the activation of the DE (Driver Enable) signal and the beginning of the start bit. It is expressed in sample time units (1/8 or 1/16 bit time, depending on the oversampling rate). This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If the Driver Enable feature is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Bit 26: Receiver timeout interrupt enable This bit is set and cleared by software. Note: If the USART does not support the Receiver timeout feature, this bit is reserved and must be kept at reset value. ..
Allowed values:
0x0: B_0x0: Interrupt inhibited
0x1: B_0x1: USART interrupt generated when the RTOF bit is set in the USART_ISR register.
Bit 27: End of Block interrupt enable This bit is set and cleared by software. Note: If the USART does not support Smartcard mode, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Interrupt inhibited
0x1: B_0x1: USART interrupt generated when the EOBF flag is set in the USART_ISR register
Bit 28: Word length This bit must be used in conjunction with bit 12 (M0) to determine the word length. It is set or cleared by software. M[1:0] = '00â: 1 start bit, 8 Data bits, n Stop bit M[1:0] = '01â: 1 start bit, 9 Data bits, n Stop bit M[1:0] = '10â: 1 start bit, 7 Data bits, n Stop bit This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: In 7-bits data length mode, the Smartcard mode, LIN master mode and Auto baud rate (0x7F and 0x55 frames detection) are not supported..
Bit 29: FIFO mode enable This bit is set and cleared by software. This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: FIFO mode can be used on standard UART communication, in SPI master/slave mode and in Smartcard modes only. It must not be enabled in IrDA and LIN modes..
Allowed values:
0x0: B_0x0: FIFO mode is disabled.
0x1: B_0x1: FIFO mode is enabled.
Control register 2
Offset: 0x4, reset: 0x0000, access: read-write
19/20 fields covered.
Bit 3: When the DIS_NSS bit is set, the NSS pin input is ignored. Note: When SPI slave mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: SPI slave selection depends on NSS input pin.
0x1: B_0x1: SPI slave is always selected and NSS input pin is ignored.
Bit 4: 7-bit Address Detection/4-bit Address Detection This bit is for selection between 4-bit address detection or 7-bit address detection. This bit can only be written when the USART is disabled (UEÂ =Â 0) Note: In 7-bit and 9-bit data modes, the address detection is done on 6-bit and 8-bit address (ADD[5:0] and ADD[7:0]) respectively..
Allowed values:
0x0: B_0x0: 4-bit address detection
0x1: B_0x1: 7-bit address detection (in 8-bit data mode)
Bit 5: LIN break detection length This bit is for selection between 11 bit or 10 bit break detection. This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If LIN mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: 10-bit break detection
0x1: B_0x1: 11-bit break detection
Bit 6: LIN break detection interrupt enable Break interrupt mask (break detection using break delimiter). Note: If LIN mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Interrupt is inhibited
0x1: B_0x1: An interrupt is generated whenever LBDF = 1 in the USART_ISR register
Bit 8: Last bit clock pulse This bit is used to select whether the clock pulse associated with the last data bit transmitted (MSB) has to be output on the SCLK pin in synchronous mode. The last bit is the 7th or 8th or 9th data bit transmitted depending on the 7 or 8 or 9 bit format selected by the M bit in the USART_CR1 register. This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If synchronous mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: The clock pulse of the last data bit is not output to the SCLK pin
0x1: B_0x1: The clock pulse of the last data bit is output to the SCLK pin
Bit 9: Clock phase This bit is used to select the phase of the clock output on the SCLK pin in synchronous mode. It works in conjunction with the CPOL bit to produce the desired clock/data relationship (see and ) This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If synchronous mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: The first clock transition is the first data capture edge
0x1: B_0x1: The second clock transition is the first data capture edge
Bit 10: Clock polarity This bit enables the user to select the polarity of the clock output on the SCLK pin in synchronous mode. It works in conjunction with the CPHA bit to produce the desired clock/data relationship This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If synchronous mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Steady low value on SCLK pin outside transmission window
0x1: B_0x1: Steady high value on SCLK pin outside transmission window
Bit 11: Clock enable This bit enables the user to enable the SCLK pin. This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If neither synchronous mode nor Smartcard mode is supported, this bit is reserved and must be kept at reset value. Refer to . In Smartcard mode, in order to provide correctly the SCLK clock to the smartcard, the steps below must be respected: UE = 0 SCEN = 1 GTPR configuration CLKEN= 1 UE = 1.
Allowed values:
0x0: B_0x0: SCLK pin disabled
0x1: B_0x1: SCLK pin enabled
Bit 14: LIN mode enable This bit is set and cleared by software. The LIN mode enables the capability to send LIN synchronous breaks (13 low bits) using the SBKRQ bit in the USART_CR1 register, and to detect LIN Sync breaks. This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If the USART does not support LIN mode, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: LIN mode disabled
0x1: B_0x1: LIN mode enabled
Bit 15: Swap TX/RX pins This bit is set and cleared by software. This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: TX/RX pins are used as defined in standard pinout
0x1: B_0x1: The TX and RX pins functions are swapped. This enables to work in the case of a cross-wired connection to another UART.
Bit 16: RX pin active level inversion This bit is set and cleared by software. This enables the use of an external inverter on the RX line. This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: RX pin signal works using the standard logic levels (VDD =1/idle, Gnd = 0/mark)
0x1: B_0x1: RX pin signal values are inverted (VDD =0/mark, Gnd = 1/idle).
Bit 17: TX pin active level inversion This bit is set and cleared by software. This enables the use of an external inverter on the TX line. This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: TX pin signal works using the standard logic levels (VDD =1/idle, Gnd = 0/mark)
0x1: B_0x1: TX pin signal values are inverted (VDD =0/mark, Gnd = 1/idle).
Bit 18: Binary data inversion This bit is set and cleared by software. This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: Logical data from the data register are send/received in positive/direct logic. (1 = H, 0 = L)
0x1: B_0x1: Logical data from the data register are send/received in negative/inverse logic. (1 = L, 0 = H). The parity bit is also inverted.
Bit 19: Most significant bit first This bit is set and cleared by software. This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: data is transmitted/received with data bit 0 first, following the start bit.
0x1: B_0x1: data is transmitted/received with the MSB (bit 7/8) first, following the start bit.
Bit 20: Auto baud rate enable This bit is set and cleared by software. Note: If the USART does not support the auto baud rate feature, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Auto baud rate detection is disabled.
0x1: B_0x1: Auto baud rate detection is enabled.
Bits 21-22: Auto baud rate mode These bits are set and cleared by software. This bitfield can only be written when ABREN = 0 or the USART is disabled (UEÂ =Â 0). Note: If DATAINVÂ =Â 1 and/or MSBFIRSTÂ =Â 1 the patterns must be the same on the line, for example 0xAA for MSBFIRST) If the USART does not support the auto baud rate feature, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Measurement of the start bit is used to detect the baud rate.
0x1: B_0x1: Falling edge to falling edge measurement (the received frame must start with a single bit = 1 and Frame = Start10xxxxxx)
0x2: B_0x2: 0x7F frame detection.
0x3: B_0x3: 0x55 frame detection
Bit 23: Receiver timeout enable This bit is set and cleared by software. When this feature is enabled, the RTOF flag in the USART_ISR register is set if the RX line is idle (no reception) for the duration programmed in the RTOR (receiver timeout register). Note: If the USART does not support the Receiver timeout feature, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Receiver timeout feature disabled.
0x1: B_0x1: Receiver timeout feature enabled.
Bits 24-31: Address of the USART node ADD[7:4]: These bits give the address of the USART node or a character code to be recognized. They are used to wake up the MCU with 7-bit address mark detection in multiprocessor communication during Mute mode or low-power mode. The MSB of the character sent by the transmitter should be equal to 1. They can also be used for character detection during normal reception, Mute mode inactive (for example, end of block detection in ModBus protocol). In this case, the whole received character (8-bit) is compared to the ADD[7:0] value and CMF flag is set on match. These bits can only be written when reception is disabled (RE = 0) or the USART is disabled (UEÂ =Â 0). ADD[3:0]: These bits give the address of the USART node or a character code to be recognized. They are used for wakeup with address mark detection, in multiprocessor communication during Mute mode or low-power mode. These bits can only be written when reception is disabled (RE = 0) or the USART is disabled (UEÂ =Â 0)..
Control register 3
Offset: 0x8, reset: 0x0000, access: read-write
24/24 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
TXFTCFG
rw |
RXFTIE
rw |
RXFTCFG
rw |
TCBGTIE
rw |
TXFTIE
rw |
WUFIE
rw |
WUS
rw |
SCARCNT
rw |
||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
DEP
rw |
DEM
rw |
DDRE
rw |
OVRDIS
rw |
ONEBIT
rw |
CTSIE
rw |
CTSE
rw |
RTSE
rw |
DMAT
rw |
DMAR
rw |
SCEN
rw |
NACK
rw |
HDSEL
rw |
IRLP
rw |
IREN
rw |
EIE
rw |
Bit 0: Error interrupt enable Error Interrupt Enable Bit is required to enable interrupt generation in case of a framing error, overrun error noise flag or SPI slave underrun error (FEÂ =Â 1 or OREÂ =Â 1 or NEÂ =Â 1 or UDR = 1 in the USART_ISR register)..
Allowed values:
0x0: B_0x0: Interrupt inhibited
0x1: B_0x1: interrupt generated when FE = 1 or ORE = 1 or NE = 1 or UDR = 1 (in SPI slave mode) in the USART_ISR register.
Bit 1: IrDA mode enable This bit is set and cleared by software. This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If IrDA mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: IrDA disabled
0x1: B_0x1: IrDA enabled
Bit 2: IrDA low-power This bit is used for selecting between normal and low-power IrDA modes This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If IrDA mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Normal mode
0x1: B_0x1: Low-power mode
Bit 4: Smartcard NACK enable This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If the USART does not support Smartcard mode, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: NACK transmission in case of parity error is disabled
0x1: B_0x1: NACK transmission during parity error is enabled
Bit 5: Smartcard mode enable This bit is used for enabling Smartcard mode. This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If the USART does not support Smartcard mode, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Smartcard Mode disabled
0x1: B_0x1: Smartcard Mode enabled
Bit 8: RTS enable This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If the hardware flow control feature is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: RTS hardware flow control disabled
0x1: B_0x1: RTS output enabled, data is only requested when there is space in the receive buffer. The transmission of data is expected to cease after the current character has been transmitted. The nRTS output is asserted (pulled to 0) when data can be received.
Bit 9: CTS enable This bit can only be written when the USART is disabled (UEÂ =Â 0) Note: If the hardware flow control feature is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: CTS hardware flow control disabled
0x1: B_0x1: CTS mode enabled, data is only transmitted when the nCTS input is asserted (tied to 0). If the nCTS input is deasserted while data is being transmitted, then the transmission is completed before stopping. If data is written into the data register while nCTS is asserted, the transmission is postponed until nCTS is asserted.
Bit 11: One sample bit method enable This bit enables the user to select the sample method. When the one sample bit method is selected the noise detection flag (NE) is disabled. This bit can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: Three sample bit method
0x1: B_0x1: One sample bit method
Bit 12: Overrun Disable This bit is used to disable the receive overrun detection. the ORE flag is not set and the new received data overwrites the previous content of the USART_RDR register. When FIFO mode is enabled, the RXFIFO is bypassed and data is written directly in USART_RDR register. Even when FIFO management is enabled, the RXNE flag is to be used. This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: This control bit enables checking the communication flow w/o reading the data.
Allowed values:
0x0: B_0x0: Overrun Error Flag, ORE, is set when received data is not read before receiving new data.
0x1: B_0x1: Overrun functionality is disabled. If new data is received while the RXNE flag is still set
Bit 13: DMA Disable on Reception Error This bit can only be written when the USART is disabled (UE=0). Note: The reception errors are: parity error, framing error or noise error..
Allowed values:
0x0: B_0x0: DMA is not disabled in case of reception error. The corresponding error flag is set but RXNE is kept 0 preventing from overrun. As a consequence, the DMA request is not asserted, so the erroneous data is not transferred (no DMA request), but next correct received data is transferred (used for Smartcard mode).
0x1: B_0x1: DMA is disabled following a reception error. The corresponding error flag is set, as well as RXNE. The DMA request is masked until the error flag is cleared. This means that the software must first disable the DMA request (DMAR = 0) or clear RXNE/RXFNE is case FIFO mode is enabled) before clearing the error flag.
Bit 14: Driver enable mode This bit enables the user to activate the external transceiver control, through the DE signal. This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If the Driver Enable feature is not supported, this bit is reserved and must be kept at reset value. ..
Allowed values:
0x0: B_0x0: DE function is disabled.
0x1: B_0x1: DE function is enabled. The DE signal is output on the RTS pin.
Bit 15: Driver enable polarity selection This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If the Driver Enable feature is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: DE signal is active high.
0x1: B_0x1: DE signal is active low.
Bits 17-19: Smartcard auto-retry count This bitfield specifies the number of retries for transmission and reception in Smartcard mode. In transmission mode, it specifies the number of automatic retransmission retries, before generating a transmission error (FE bit set). In reception mode, it specifies the number or erroneous reception trials, before generating a reception error (RXNE/RXFNE and PE bits set). This bitfield must be programmed only when the USART is disabled (UEÂ =Â 0). When the USART is enabled (UEÂ =Â 1), this bitfield may only be written to 0x0, in order to stop retransmission. Note: If Smartcard mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: retransmission disabled - No automatic retransmission in transmit mode.
0x1: B_0x1: number of automatic retransmission attempts (before signaling error)
0x2: B_0x2: number of automatic retransmission attempts (before signaling error)
0x3: B_0x3: number of automatic retransmission attempts (before signaling error)
0x4: B_0x4: number of automatic retransmission attempts (before signaling error)
0x5: B_0x5: number of automatic retransmission attempts (before signaling error)
0x6: B_0x6: number of automatic retransmission attempts (before signaling error)
0x7: B_0x7: number of automatic retransmission attempts (before signaling error)
Bits 20-21: Wakeup from low-power mode interrupt flag selection This bitfield specifies the event which activates the WUF (Wakeup from low-power mode flag). This bitfield can only be written when the USART is disabled (UE = 0). If the USART does not support the wakeup from Stop feature, this bit is reserved and must be kept at reset value. Refer to page 835..
Allowed values:
0x0: B_0x0: WUF active on address match (as defined by ADD[7:0] and ADDM7)
0x2: B_0x2: WUF active on start bit detection
0x3: B_0x3: WUF active on RXNE/RXFNE.
Bit 22: Wakeup from low-power mode interrupt enable This bit is set and cleared by software. Note: WUFIE must be set before entering in low-power mode. If the USART does not support the wakeup from Stop feature, this bit is reserved and must be kept at reset value. Refer to page 835..
Allowed values:
0x0: B_0x0: Interrupt inhibited
0x1: B_0x1: USART interrupt generated whenever WUF = 1 in the USART_ISR register
Bit 24: Transmission Complete before guard time, interrupt enable This bit is set and cleared by software. Note: If the USART does not support the Smartcard mode, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Interrupt inhibited
0x1: B_0x1: USART interrupt generated whenever TCBGT=1 in the USART_ISR register
Bits 25-27: Receive FIFO threshold configuration Remaining combinations: Reserved.
Allowed values:
0x0: B_0x0: Receive FIFO reaches 1/8 of its depth
0x1: B_0x1: Receive FIFO reaches 1/4 of its depth
0x2: B_0x2: Receive FIFO reaches 1/2 of its depth
0x3: B_0x3: Receive FIFO reaches 3/4 of its depth
0x4: B_0x4: Receive FIFO reaches 7/8 of its depth
0x5: B_0x5: Receive FIFO becomes full
Bits 29-31: TXFIFO threshold configuration Remaining combinations: Reserved.
Allowed values:
0x0: B_0x0: TXFIFO reaches 1/8 of its depth
0x1: B_0x1: TXFIFO reaches 1/4 of its depth
0x2: B_0x2: TXFIFO reaches 1/2 of its depth
0x3: B_0x3: TXFIFO reaches 3/4 of its depth
0x4: B_0x4: TXFIFO reaches 7/8 of its depth
0x5: B_0x5: TXFIFO becomes empty
Baud rate register
Offset: 0xC, reset: 0x0000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
BRR
rw |
|||||||||||||||
Guard time and prescaler register
Offset: 0x10, reset: 0x0000, access: read-write
1/2 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
GT
rw |
PSC
rw |
||||||||||||||
Bits 0-7: Prescaler value In IrDA low-power and normal IrDA mode: PSC[7:0] = IrDA Normal and Low-Power baud rate PSC[7:0] is used to program the prescaler for dividing the USART source clock to achieve the low-power frequency: the source clock is divided by the value given in the register (8 significant bits): In Smartcard mode: PSC[4:0]Â =Â Prescaler value PSC[4:0] is used to program the prescaler for dividing the USART source clock to provide the Smartcard clock. The value given in the register (5 significant bits) is multiplied by 2 to give the division factor of the source clock frequency: ... 0010Â 0000: Divides the source clock by 32 (IrDA mode) ... 1111Â 1111: Divides the source clock by 255 (IrDA mode) This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: Bits [7:5] must be kept cleared if Smartcard mode is used. This bitfield is reserved and forced by hardware to '0â when the Smartcard and IrDA modes are not supported. Refer to ..
Allowed values:
0x0: B_0x0: Reserved - do not program this value
0x1: B_0x1: Divides the source clock by 1 (IrDA mode) / by 2 (Smarcard mode)
0x2: B_0x2: Divides the source clock by 2 (IrDA mode) / by 4 (Smartcard mode)
0x3: B_0x3: Divides the source clock by 3 (IrDA mode) / by 6 (Smartcard mode)
0x1F: B_0x1F: Divides the source clock by 31 (IrDA mode) / by 62 (Smartcard mode)
Bits 8-15: Guard time value This bitfield is used to program the Guard time value in terms of number of baud clock periods. This is used in Smartcard mode. The Transmission Complete flag is set after this guard time value. This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If Smartcard mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Receiver timeout register
Offset: 0x14, reset: 0x0000, access: read-write
0/2 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
BLEN
rw |
RTO
rw |
||||||||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
RTO
rw |
|||||||||||||||
Request register
Offset: 0x18, reset: 0x0000, access: write-only
0/5 fields covered.
Bit 0: Auto baud rate request Writing 1 to this bit resets the ABRF flag in the USART_ISR and requests an automatic baud rate measurement on the next received data frame. Note: If the USART does not support the auto baud rate feature, this bit is reserved and must be kept at reset value. Refer to ..
Bit 1: Send break request Writing 1 to this bit sets the SBKF flag and request to send a BREAK on the line, as soon as the transmit machine is available. Note: When the application needs to send the break character following all previously inserted data, including the ones not yet transmitted, the software should wait for the TXE flag assertion before setting the SBKRQ bit..
Bit 4: Transmit data flush request When FIFO mode is disabled, writing '1â to this bit sets the TXE flag. This enables to discard the transmit data. This bit must be used only in Smartcard mode, when data have not been sent due to errors (NACK) and the FE flag is active in the USART_ISR register. If the USART does not support Smartcard mode, this bit is reserved and must be kept at reset value. When FIFO is enabled, TXFRQ bit is set to flush the whole FIFO. This sets the TXFE flag (Transmit FIFO empty, bit 23 in the USART_ISR register). Flushing the Transmit FIFO is supported in both UART and Smartcard modes. Note: In FIFO mode, the TXFNF flag is reset during the flush request until TxFIFO is empty in order to ensure that no data are written in the data register..
Interrupt & status register
Offset: 0x1C, reset: 0x000000C0, access: read-only
24/24 fields covered.
Bit 0: Parity error This bit is set by hardware when a parity error occurs in receiver mode. It is cleared by software, writing 1 to the PECF in the USART_ICR register. An interrupt is generated if PEIE = 1 in the USART_CR1 register..
Allowed values:
0x0: B_0x0: No parity error
0x1: B_0x1: Parity error
Bit 1: Framing error This bit is set by hardware when a de-synchronization, excessive noise or a break character is detected. It is cleared by software, writing 1 to the FECF bit in the USART_ICR register. When transmitting data in Smartcard mode, this bit is set when the maximum number of transmit attempts is reached without success (the card NACKs the data frame). An interrupt is generated if EIEÂ =Â 1 in the USART_CR1 register..
Allowed values:
0x0: B_0x0: No Framing error is detected
0x1: B_0x1: Framing error or break character is detected
Bit 2: Noise detection flag This bit is set by hardware when noise is detected on a received frame. It is cleared by software, writing 1 to the NECF bit in the USART_ICR register. Note: This bit does not generate an interrupt as it appears at the same time as the RXNE bit which itself generates an interrupt. An interrupt is generated when the NE flag is set during multi buffer communication if the EIE bit is set. When the line is noise-free, the NE flag can be disabled by programming the ONEBIT bit to 1 to increase the USART tolerance to deviations (Refer to Tolerance of the USART receiver to clock deviation on page 861)..
Allowed values:
0x0: B_0x0: No noise is detected
0x1: B_0x1: Noise is detected
Bit 3: Overrun error This bit is set by hardware when the data currently being received in the shift register is ready to be transferred into the USART_RDR register while RXNEÂ =Â 1. It is cleared by a software, writing 1 to the ORECF, in the USART_ICR register. An interrupt is generated if RXNEIEÂ =Â 1 or EIE Â =Â 1 in the USART_CR1 register. Note: When this bit is set, the USART_RDR register content is not lost but the shift register is overwritten. An interrupt is generated if the ORE flag is set during multi buffer communication if the EIE bit is set. This bit is permanently forced to 0 (no overrun detection) when the bit OVRDIS is set in the USART_CR3 register..
Allowed values:
0x0: B_0x0: No overrun error
0x1: B_0x1: Overrun error is detected
Bit 4: Idle line detected This bit is set by hardware when an Idle Line is detected. An interrupt is generated if IDLEIEÂ =Â 1 in the USART_CR1 register. It is cleared by software, writing 1 to the IDLECF in the USART_ICR register. Note: The IDLE bit is not set again until the RXNE bit has been set (i.e. a new idle line occurs). If Mute mode is enabled (MMEÂ =Â 1), IDLE is set if the USART is not mute (RWUÂ =Â 0), whatever the Mute mode selected by the WAKE bit. If RWUÂ =Â 1, IDLE is not set..
Allowed values:
0x0: B_0x0: No Idle line is detected
0x1: B_0x1: Idle line is detected
Bit 5: Read data register not empty RXNE bit is set by hardware when the content of the USART_RDR shift register has been transferred to the USART_RDR register. It is cleared by reading from the USART_RDR register. The RXNE flag can also be cleared by writing 1 to the RXFRQ in the USART_RQR register. An interrupt is generated if RXNEIEÂ =Â 1 in the USART_CR1 register..
Allowed values:
0x0: B_0x0: Data is not received
0x1: B_0x1: Received data is ready to be read.
Bit 6: Transmission complete This bit indicates that the last data written in the USART_TDR has been transmitted out of the shift register. It is set by hardware when the transmission of a frame containing data is complete and when TXE is set. An interrupt is generated if TCIEÂ =Â 1 in the USART_CR1 register. TC bit is is cleared by software, by writing 1 to the TCCF in the USART_ICR register or by a write to the USART_TDR register. Note: If TE bit is reset and no transmission is on going, the TC bit is set immediately..
Allowed values:
0x0: B_0x0: Transmission is not complete
0x1: B_0x1: Transmission is complete
Bit 7: Transmit data register empty TXE is set by hardware when the content of the USART_TDR register has been transferred into the shift register. It is cleared by writing to the USART_TDR register. The TXE flag can also be set by writing 1 to the TXFRQ in the USART_RQR register, in order to discard the data (only in Smartcard T = 0 mode, in case of transmission failure). An interrupt is generated if the TXEIE bit  = 1 in the USART_CR1 register..
Allowed values:
0x0: B_0x0: Data register full
0x1: B_0x1: Data register not full
Bit 8: LIN break detection flag This bit is set by hardware when the LIN break is detected. It is cleared by software, by writing 1 to the LBDCF in the USART_ICR. An interrupt is generated if LBDIE = 1 in the USART_CR2 register. Note: If the USART does not support LIN mode, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: LIN Break not detected
0x1: B_0x1: LIN break detected
Bit 9: CTS interrupt flag This bit is set by hardware when the nCTS input toggles, if the CTSE bit is set. It is cleared by software, by writing 1 to the CTSCF bit in the USART_ICR register. An interrupt is generated if CTSIEÂ =Â 1 in the USART_CR3 register. Note: If the hardware flow control feature is not supported, this bit is reserved and kept at reset value..
Allowed values:
0x0: B_0x0: No change occurred on the nCTS status line
0x1: B_0x1: A change occurred on the nCTS status line
Bit 11: Receiver timeout This bit is set by hardware when the timeout value, programmed in the RTOR register has lapsed, without any communication. It is cleared by software, writing 1 to the RTOCF bit in the USART_ICR register. An interrupt is generated if RTOIEÂ =Â 1 in the USART_CR2 register. In Smartcard mode, the timeout corresponds to the CWT or BWT timings. Note: If a time equal to the value programmed in RTOR register separates 2 characters, RTOF is not set. If this time exceeds this value + 2 sample times (2/16 or 2/8, depending on the oversampling method), RTOF flag is set. The counter counts even if RE = 0 but RTOF is set only when RE = 1. If the timeout has already elapsed when RE is set, then RTOF is set. If the USART does not support the Receiver timeout feature, this bit is reserved and kept at reset value..
Allowed values:
0x0: B_0x0: Timeout value not reached
0x1: B_0x1: Timeout value reached without any data reception
Bit 12: End of block flag This bit is set by hardware when a complete block has been received (for example TÂ =Â 1 Smartcard mode). The detection is done when the number of received bytes (from the start of the block, including the prologue) is equal or greater than BLEN + 4. An interrupt is generated if the EOBIEÂ =Â 1 in the USART_CR2 register. It is cleared by software, writing 1 to the EOBCF in the USART_ICR register. Note: If Smartcard mode is not supported, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: End of Block not reached
0x1: B_0x1: End of Block (number of characters) reached
Bit 13: SPI slave underrun error flag In slave transmission mode, this flag is set when the first clock pulse for data transmission appears while the software has not yet loaded any value into USART_TDR. This flag is reset by setting UDRCF bit in the USART_ICR register. Note: If the USART does not support the SPI slave mode, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: No underrun error
0x1: B_0x1: underrun error
Bit 14: Auto baud rate error This bit is set by hardware if the baud rate measurement failed (baud rate out of range or character comparison failed) It is cleared by software, by writing 1 to the ABRRQ bit in the USART_CR3 register. Note: If the USART does not support the auto baud rate feature, this bit is reserved and kept at reset value..
Bit 15: Auto baud rate flag This bit is set by hardware when the automatic baud rate has been set (RXNE is also set, generating an interrupt if RXNEIE = 1) or when the auto baud rate operation was completed without success (ABREÂ =Â 1) (ABRE, RXNE and FE are also set in this case) It is cleared by software, in order to request a new auto baud rate detection, by writing 1 to the ABRRQ in the USART_RQR register. Note: If the USART does not support the auto baud rate feature, this bit is reserved and kept at reset value..
Bit 16: Busy flag This bit is set and reset by hardware. It is active when a communication is ongoing on the RX line (successful start bit detected). It is reset at the end of the reception (successful or not)..
Allowed values:
0x0: B_0x0: USART is idle (no reception)
0x1: B_0x1: Reception on going
Bit 17: Character match flag This bit is set by hardware, when a the character defined by ADD[7:0] is received. It is cleared by software, writing 1 to the CMCF in the USART_ICR register. An interrupt is generated if CMIEÂ =Â 1in the USART_CR1 register..
Allowed values:
0x0: B_0x0: No Character match detected
0x1: B_0x1: Character Match detected
Bit 18: Send break flag This bit indicates that a send break character was requested. It is set by software, by writing 1 to the SBKRQ bit in the USART_CR3 register. It is automatically reset by hardware during the stop bit of break transmission..
Allowed values:
0x0: B_0x0: Break character transmitted
0x1: B_0x1: Break character requested by setting SBKRQ bit in USART_RQR register
Bit 19: Receiver wakeup from Mute mode This bit indicates if the USART is in Mute mode. It is cleared/set by hardware when a wakeup/mute sequence is recognized. The Mute mode control sequence (address or IDLE) is selected by the WAKE bit in the USART_CR1 register. When wakeup on IDLE mode is selected, this bit can only be set by software, writing 1 to the MMRQ bit in the USART_RQR register. Note: If the USART does not support the wakeup from Stop feature, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Receiver in active mode
0x1: B_0x1: Receiver in Mute mode
Bit 20: Wakeup from low-power mode flag This bit is set by hardware, when a wakeup event is detected. The event is defined by the WUS bitfield. It is cleared by software, writing a 1 to the WUCF in the USART_ICR register. An interrupt is generated if WUFIEÂ =Â 1 in the USART_CR3 register. Note: When UESM is cleared, WUF flag is also cleared. If the USART does not support the wakeup from Stop feature, this bit is reserved and kept at reset value. Refer to ..
Bit 21: Transmit enable acknowledge flag This bit is set/reset by hardware, when the Transmit Enable value is taken into account by the USART. It can be used when an idle frame request is generated by writing TEÂ =Â 0, followed by TEÂ =Â 1 in the USART_CR1 register, in order to respect the TEÂ =Â 0 minimum period..
Bit 22: Receive enable acknowledge flag This bit is set/reset by hardware, when the Receive Enable value is taken into account by the USART. It can be used to verify that the USART is ready for reception before entering low-power mode. Note: If the USART does not support the wakeup from Stop feature, this bit is reserved and kept at reset value. Refer to ..
Bit 25: Transmission complete before guard time flag This bit is set when the last data written in the USART_TDR has been transmitted correctly out of the shift register. It is set by hardware in Smartcard mode, if the transmission of a frame containing data is complete and if the smartcard did not send back any NACK. An interrupt is generated if TCBGTIE = 1 in the USART_CR3 register. This bit is cleared by software, by writing 1 to the TCBGTCF in the USART_ICR register or by a write to the USART_TDR register. Note: If the USART does not support the Smartcard mode, this bit is reserved and kept at reset value. If the USART supports the Smartcard mode and the Smartcard mode is enabled, the TCBGT reset value is '1â. Refer to on page 835..
Allowed values:
0x0: B_0x0: Transmission is not complete or transmission is complete unsuccessfully (i.e. a NACK is received from the card)
0x1: B_0x1: Transmission is complete successfully (before Guard time completion and there is no NACK from the smart card).
Interrupt & status register
Offset: 0x1C, reset: 0x008000C0, access: read-only
28/28 fields covered.
Bit 0: Parity error This bit is set by hardware when a parity error occurs in receiver mode. It is cleared by software, writing 1 to the PECF in the USART_ICR register. An interrupt is generated if PEIE = 1 in the USART_CR1 register. Note: This error is associated with the character in the USART_RDR..
Allowed values:
0x0: B_0x0: No parity error
0x1: B_0x1: Parity error
Bit 1: Framing error This bit is set by hardware when a de-synchronization, excessive noise or a break character is detected. It is cleared by software, writing 1 to the FECF bit in the USART_ICR register. When transmitting data in Smartcard mode, this bit is set when the maximum number of transmit attempts is reached without success (the card NACKs the data frame). An interrupt is generated if EIEÂ =Â 1 in the USART_CR1 register. Note: This error is associated with the character in the USART_RDR..
Allowed values:
0x0: B_0x0: No Framing error is detected
0x1: B_0x1: Framing error or break character is detected
Bit 2: Noise detection flag This bit is set by hardware when noise is detected on a received frame. It is cleared by software, writing 1 to the NECF bit in the USART_ICR register. Note: This bit does not generate an interrupt as it appears at the same time as the RXFNE bit which itself generates an interrupt. An interrupt is generated when the NE flag is set during multi buffer communication if the EIE bit is set. When the line is noise-free, the NE flag can be disabled by programming the ONEBIT bit to 1 to increase the USART tolerance to deviations (Refer to Tolerance of the USART receiver to clock deviation on page 861). This error is associated with the character in the USART_RDR..
Allowed values:
0x0: B_0x0: No noise is detected
0x1: B_0x1: Noise is detected
Bit 3: Overrun error This bit is set by hardware when the data currently being received in the shift register is ready to be transferred into the USART_RDR register while RXFF = 1. It is cleared by a software, writing 1 to the ORECF, in the USART_ICR register. An interrupt is generated if RXFNEIEÂ =Â 1 or EIE = 1 in the USART_CR1 register. Note: When this bit is set, the USART_RDR register content is not lost but the shift register is overwritten. An interrupt is generated if the ORE flag is set during multi buffer communication if the EIE bit is set. This bit is permanently forced to 0 (no overrun detection) when the bit OVRDIS is set in the USART_CR3 register..
Allowed values:
0x0: B_0x0: No overrun error
0x1: B_0x1: Overrun error is detected
Bit 4: Idle line detected This bit is set by hardware when an Idle Line is detected. An interrupt is generated if IDLEIEÂ =Â 1 in the USART_CR1 register. It is cleared by software, writing 1 to the IDLECF in the USART_ICR register. Note: The IDLE bit is not set again until the RXFNE bit has been set (i.e. a new idle line occurs). If Mute mode is enabled (MMEÂ =Â 1), IDLE is set if the USART is not mute (RWUÂ =Â 0), whatever the Mute mode selected by the WAKE bit. If RWUÂ =Â 1, IDLE is not set..
Allowed values:
0x0: B_0x0: No Idle line is detected
0x1: B_0x1: Idle line is detected
Bit 5: RXFIFO not empty RXFNE bit is set by hardware when the RXFIFO is not empty, meaning that data can be read from the USART_RDR register. Every read operation from the USART_RDR frees a location in the RXFIFO. RXFNE is cleared when the RXFIFO is empty. The RXFNE flag can also be cleared by writing 1 to the RXFRQ in the USART_RQR register. An interrupt is generated if RXFNEIEÂ =Â 1 in the USART_CR1 register..
Allowed values:
0x0: B_0x0: Data is not received
0x1: B_0x1: Received data is ready to be read.
Bit 6: Transmission complete This bit indicates that the last data written in the USART_TDR has been transmitted out of the shift register. It is set by hardware when the transmission of a frame containing data is complete and when TXFE is set. An interrupt is generated if TCIEÂ =Â 1 in the USART_CR1 register. TC bit is is cleared by software, by writing 1 to the TCCF in the USART_ICR register or by a write to the USART_TDR register. Note: If TE bit is reset and no transmission is on going, the TC bit is immediately set..
Allowed values:
0x0: B_0x0: Transmission is not complete
0x1: B_0x1: Transmission is complete
Bit 7: TXFIFO not full TXFNF is set by hardware when TXFIFO is not full meaning that data can be written in the USART_TDR. Every write operation to the USART_TDR places the data in the TXFIFO. This flag remains set until the TXFIFO is full. When the TXFIFO is full, this flag is cleared indicating that data can not be written into the USART_TDR. An interrupt is generated if the TXFNFIE bit =1 in the USART_CR1 register. Note: The TXFNF is kept reset during the flush request until TXFIFO is empty. After sending the flush request (by setting TXFRQ bit), the flag TXFNF should be checked prior to writing in TXFIFO (TXFNF and TXFE are set at the same time). This bit is used during single buffer transmission..
Allowed values:
0x0: B_0x0: Transmit FIFO is full
0x1: B_0x1: Transmit FIFO is not full
Bit 8: LIN break detection flag This bit is set by hardware when the LIN break is detected. It is cleared by software, by writing 1 to the LBDCF in the USART_ICR. An interrupt is generated if LBDIE = 1 in the USART_CR2 register. Note: If the USART does not support LIN mode, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: LIN Break not detected
0x1: B_0x1: LIN break detected
Bit 9: CTS interrupt flag This bit is set by hardware when the nCTS input toggles, if the CTSE bit is set. It is cleared by software, by writing 1 to the CTSCF bit in the USART_ICR register. An interrupt is generated if CTSIEÂ =Â 1 in the USART_CR3 register. Note: If the hardware flow control feature is not supported, this bit is reserved and kept at reset value..
Allowed values:
0x0: B_0x0: No change occurred on the nCTS status line
0x1: B_0x1: A change occurred on the nCTS status line
Bit 11: Receiver timeout This bit is set by hardware when the timeout value, programmed in the RTOR register has lapsed, without any communication. It is cleared by software, writing 1 to the RTOCF bit in the USART_ICR register. An interrupt is generated if RTOIEÂ =Â 1 in the USART_CR2 register. In Smartcard mode, the timeout corresponds to the CWT or BWT timings. Note: If a time equal to the value programmed in RTOR register separates 2 characters, RTOF is not set. If this time exceeds this value + 2 sample times (2/16 or 2/8, depending on the oversampling method), RTOF flag is set. The counter counts even if RE = 0 but RTOF is set only when RE = 1. If the timeout has already elapsed when RE is set, then RTOF is set. If the USART does not support the Receiver timeout feature, this bit is reserved and kept at reset value..
Allowed values:
0x0: B_0x0: Timeout value not reached
0x1: B_0x1: Timeout value reached without any data reception
Bit 12: End of block flag This bit is set by hardware when a complete block has been received (for example TÂ =Â 1 Smartcard mode). The detection is done when the number of received bytes (from the start of the block, including the prologue) is equal or greater than BLEN + 4. An interrupt is generated if the EOBIEÂ =Â 1 in the USART_CR2 register. It is cleared by software, writing 1 to the EOBCF in the USART_ICR register. Note: If Smartcard mode is not supported, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: End of Block not reached
0x1: B_0x1: End of Block (number of characters) reached
Bit 13: SPI slave underrun error flag In slave transmission mode, this flag is set when the first clock pulse for data transmission appears while the software has not yet loaded any value into USART_TDR. This flag is reset by setting UDRCF bit in the USART_ICR register. Note: If the USART does not support the SPI slave mode, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: No underrun error
0x1: B_0x1: underrun error
Bit 14: Auto baud rate error This bit is set by hardware if the baud rate measurement failed (baud rate out of range or character comparison failed) It is cleared by software, by writing 1 to the ABRRQ bit in the USART_CR3 register. Note: If the USART does not support the auto baud rate feature, this bit is reserved and kept at reset value..
Bit 15: Auto baud rate flag This bit is set by hardware when the automatic baud rate has been set (RXFNE is also set, generating an interrupt if RXFNEIE = 1) or when the auto baud rate operation was completed without success (ABREÂ =Â 1) (ABRE, RXFNE and FE are also set in this case) It is cleared by software, in order to request a new auto baud rate detection, by writing 1 to the ABRRQ in the USART_RQR register. Note: If the USART does not support the auto baud rate feature, this bit is reserved and kept at reset value..
Bit 16: Busy flag This bit is set and reset by hardware. It is active when a communication is ongoing on the RX line (successful start bit detected). It is reset at the end of the reception (successful or not)..
Allowed values:
0x0: B_0x0: USART is idle (no reception)
0x1: B_0x1: Reception on going
Bit 17: Character match flag This bit is set by hardware, when a the character defined by ADD[7:0] is received. It is cleared by software, writing 1 to the CMCF in the USART_ICR register. An interrupt is generated if CMIEÂ =Â 1in the USART_CR1 register..
Allowed values:
0x0: B_0x0: No Character match detected
0x1: B_0x1: Character Match detected
Bit 18: Send break flag This bit indicates that a send break character was requested. It is set by software, by writing 1 to the SBKRQ bit in the USART_CR3 register. It is automatically reset by hardware during the stop bit of break transmission..
Allowed values:
0x0: B_0x0: Break character transmitted
0x1: B_0x1: Break character requested by setting SBKRQ bit in USART_RQR register
Bit 19: Receiver wakeup from Mute mode This bit indicates if the USART is in Mute mode. It is cleared/set by hardware when a wakeup/mute sequence is recognized. The Mute mode control sequence (address or IDLE) is selected by the WAKE bit in the USART_CR1 register. When wakeup on IDLE mode is selected, this bit can only be set by software, writing 1 to the MMRQ bit in the USART_RQR register. Note: If the USART does not support the wakeup from Stop feature, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Receiver in active mode
0x1: B_0x1: Receiver in Mute mode
Bit 20: Wakeup from low-power mode flag This bit is set by hardware, when a wakeup event is detected. The event is defined by the WUS bitfield. It is cleared by software, writing a 1 to the WUCF in the USART_ICR register. An interrupt is generated if WUFIEÂ =Â 1 in the USART_CR3 register. Note: When UESM is cleared, WUF flag is also cleared. If the USART does not support the wakeup from Stop feature, this bit is reserved and kept at reset value. Refer to ..
Bit 21: Transmit enable acknowledge flag This bit is set/reset by hardware, when the Transmit Enable value is taken into account by the USART. It can be used when an idle frame request is generated by writing TEÂ =Â 0, followed by TEÂ =Â 1 in the USART_CR1 register, in order to respect the TEÂ =Â 0 minimum period..
Bit 22: Receive enable acknowledge flag This bit is set/reset by hardware, when the Receive Enable value is taken into account by the USART. It can be used to verify that the USART is ready for reception before entering low-power mode. Note: If the USART does not support the wakeup from Stop feature, this bit is reserved and kept at reset value. Refer to ..
Bit 23: TXFIFO empty This bit is set by hardware when TXFIFO is empty. When the TXFIFO contains at least one data, this flag is cleared. The TXFE flag can also be set by writing 1 to the bit TXFRQ (bit 4) in the USART_RQR register. An interrupt is generated if the TXFEIE bit  = 1 (bit 30) in the USART_CR1 register..
Allowed values:
0x0: B_0x0: TXFIFO not empty.
0x1: B_0x1: TXFIFO empty.
Bit 24: RXFIFO full This bit is set by hardware when the number of received data corresponds to RXFIFO size + 1 (RXFIFO full + 1 data in the USART_RDR register. An interrupt is generated if the RXFFIE bit  = 1 in the USART_CR1 register..
Allowed values:
0x0: B_0x0: RXFIFO not full.
0x1: B_0x1: RXFIFO Full.
Bit 25: Transmission complete before guard time flag This bit is set when the last data written in the USART_TDR has been transmitted correctly out of the shift register. It is set by hardware in Smartcard mode, if the transmission of a frame containing data is complete and if the smartcard did not send back any NACK. An interrupt is generated if TCBGTIE = 1 in the USART_CR3 register. This bit is cleared by software, by writing 1 to the TCBGTCF in the USART_ICR register or by a write to the USART_TDR register. Note: If the USART does not support the Smartcard mode, this bit is reserved and kept at reset value. If the USART supports the Smartcard mode and the Smartcard mode is enabled, the TCBGT reset value is '1â. Refer to on page 835..
Allowed values:
0x0: B_0x0: Transmission is not complete or transmission is complete unsuccessfully (i.e. a NACK is received from the card)
0x1: B_0x1: Transmission is complete successfully (before Guard time completion and there is no NACK from the smart card).
Bit 26: RXFIFO threshold flag This bit is set by hardware when the threshold programmed in RXFTCFG in USART_CR3 register is reached. This means that there are (RXFTCFG - 1) data in the Receive FIFO and one data in the USART_RDR register. An interrupt is generated if the RXFTIE bit  = 1 (bit 27) in the USART_CR3 register. Note: When the RXFTCFG threshold is configured to '101â, RXFT flag is set if 16 data are available i.e. 15 data in the RXFIFO and 1 data in the USART_RDR. Consequently, the 17th received data does not cause an overrun error. The overrun error occurs after receiving the 18th data..
Allowed values:
0x0: B_0x0: Receive FIFO does not reach the programmed threshold.
0x1: B_0x1: Receive FIFO reached the programmed threshold.
Bit 27: TXFIFO threshold flag This bit is set by hardware when the TXFIFO reaches the threshold programmed in TXFTCFG of USART_CR3 register i.e. the TXFIFO contains TXFTCFG empty locations. An interrupt is generated if the TXFTIE bit  = 1 (bit 31) in the USART_CR3 register..
Allowed values:
0x0: B_0x0: TXFIFO does not reach the programmed threshold.
0x1: B_0x1: TXFIFO reached the programmed threshold.
Receive data register
Offset: 0x24, reset: 0x0000, access: read-only
1/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
RDR
r |
|||||||||||||||
Transmit data register
Offset: 0x28, reset: 0x0000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
TDR
rw |
|||||||||||||||
Prescaler register
Offset: 0x2C, reset: 0x0000, access: read-write
1/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
PRESCALER
rw |
|||||||||||||||
Bits 0-3: Clock prescaler The USART input clock can be divided by a prescaler factor: Remaining combinations: Reserved Note: When PRESCALER is programmed with a value different of the allowed ones, programmed prescaler value is 1011 i.e. input clock divided by 256..
Allowed values:
0x0: B_0x0: input clock not divided
0x1: B_0x1: input clock divided by 2
0x2: B_0x2: input clock divided by 4
0x3: B_0x3: input clock divided by 6
0x4: B_0x4: input clock divided by 8
0x5: B_0x5: input clock divided by 10
0x6: B_0x6: input clock divided by 12
0x7: B_0x7: input clock divided by 16
0x8: B_0x8: input clock divided by 32
0x9: B_0x9: input clock divided by 64
0xA: B_0xA: input clock divided by 128
0xB: B_0xB: input clock divided by 256
0x40004800: Universal synchronous asynchronous receiver transmitter
136/170 fields covered. Toggle Registers
| Offset | Name | 31 |
30 |
29 |
28 |
27 |
26 |
25 |
24 |
23 |
22 |
21 |
20 |
19 |
18 |
17 |
16 |
15 |
14 |
13 |
12 |
11 |
10 |
9 |
8 |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x0 | CR1_FIFO_DISABLED | ||||||||||||||||||||||||||||||||
| 0x0 | CR1_FIFO_ENABLED | ||||||||||||||||||||||||||||||||
| 0x4 | CR2 | ||||||||||||||||||||||||||||||||
| 0x8 | CR3 | ||||||||||||||||||||||||||||||||
| 0xC | BRR | ||||||||||||||||||||||||||||||||
| 0x10 | GTPR | ||||||||||||||||||||||||||||||||
| 0x14 | RTOR | ||||||||||||||||||||||||||||||||
| 0x18 | RQR | ||||||||||||||||||||||||||||||||
| 0x1C | ISR_FIFO_DISABLED | ||||||||||||||||||||||||||||||||
| 0x1C | ISR_FIFO_ENABLED | ||||||||||||||||||||||||||||||||
| 0x20 | ICR | ||||||||||||||||||||||||||||||||
| 0x24 | RDR | ||||||||||||||||||||||||||||||||
| 0x28 | TDR | ||||||||||||||||||||||||||||||||
| 0x2C | PRESC | ||||||||||||||||||||||||||||||||
Control register 1
Offset: 0x0, reset: 0x0000, access: read-write
18/22 fields covered.
Bit 0: USART enable When this bit is cleared, the USART prescalers and outputs are stopped immediately, and all current operations are discarded. The USART configuration is kept, but all the USART_ISR status flags are reset. This bit is set and cleared by software. Note: To enter low-power mode without generating errors on the line, the TE bit must be previously reset and the software must wait for the TC bit in the USART_ISR to be set before resetting the UE bit. The DMA requests are also reset when UE = 0 so the DMA channel must be disabled before resetting the UE bit. In Smartcard mode, (SCEN = 1), the SCLK is always available when CLKEN = 1, regardless of the UE bit value..
Allowed values:
0x0: B_0x0: USART prescaler and outputs disabled, low-power mode
0x1: B_0x1: USART enabled
Bit 1: USART enable in low-power mode When this bit is cleared, the USART cannot wake up the MCU from low-power mode. When this bit is set, the USART can wake up the MCU from low-power mode. This bit is set and cleared by software. Note: It is recommended to set the UESM bit just before entering low-power mode and clear it when exit from low-power mode. If the USART does not support the wakeup from Stop feature, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: USART not able to wake up the MCU from low-power mode.
0x1: B_0x1: USART able to wake up the MCU from low-power mode.
Bit 3: Transmitter enable This bit enables the transmitter. It is set and cleared by software. Note: During transmission, a low pulse on the TE bit ('0â followed by '1â) sends a preamble (idle line) after the current word, except in Smartcard mode. In order to generate an idle character, the TE must not be immediately written to '1â. To ensure the required duration, the software can poll the TEACK bit in the USART_ISR register. In Smartcard mode, when TE is set, there is a 1 bit-time delay before the transmission starts..
Allowed values:
0x0: B_0x0: Transmitter is disabled
0x1: B_0x1: Transmitter is enabled
Bit 9: Parity selection This bit selects the odd or even parity when the parity generation/detection is enabled (PCE bit set). It is set and cleared by software. The parity is selected after the current byte. This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: Even parity
0x1: B_0x1: Odd parity
Bit 10: Parity control enable This bit selects the hardware parity control (generation and detection). When the parity control is enabled, the computed parity is inserted at the MSB position (9th bit if MÂ =Â 1; 8th bit if MÂ =Â 0) and the parity is checked on the received data. This bit is set and cleared by software. Once it is set, PCE is active after the current byte (in reception and in transmission). This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: Parity control disabled
0x1: B_0x1: Parity control enabled
Bit 13: Mute mode enable This bit enables the USART Mute mode function. When set, the USART can switch between active and Mute mode, as defined by the WAKE bit. It is set and cleared by software..
Allowed values:
0x0: B_0x0: Receiver in active mode permanently
0x1: B_0x1: Receiver can switch between Mute mode and active mode.
Bits 16-20: Driver Enable deassertion time This 5-bit value defines the time between the end of the last stop bit, in a transmitted message, and the de-activation of the DE (Driver Enable) signal. It is expressed in sample time units (1/8 or 1/16 bit time, depending on the oversampling rate). If the USART_TDR register is written during the DEDT time, the new data is transmitted only when the DEDT and DEAT times have both elapsed. This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If the Driver Enable feature is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Bits 21-25: Driver Enable assertion time This 5-bit value defines the time between the activation of the DE (Driver Enable) signal and the beginning of the start bit. It is expressed in sample time units (1/8 or 1/16 bit time, depending on the oversampling rate). This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If the Driver Enable feature is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Bit 26: Receiver timeout interrupt enable This bit is set and cleared by software. Note: If the USART does not support the Receiver timeout feature, this bit is reserved and must be kept at reset value. ..
Allowed values:
0x0: B_0x0: Interrupt inhibited
0x1: B_0x1: USART interrupt generated when the RTOF bit is set in the USART_ISR register.
Bit 27: End of Block interrupt enable This bit is set and cleared by software. Note: If the USART does not support Smartcard mode, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Interrupt inhibited
0x1: B_0x1: USART interrupt generated when the EOBF flag is set in the USART_ISR register
Bit 28: Word length This bit must be used in conjunction with bit 12 (M0) to determine the word length. It is set or cleared by software. M[1:0] = '00â: 1 start bit, 8 Data bits, n Stop bit M[1:0] = '01â: 1 start bit, 9 Data bits, n Stop bit M[1:0] = '10â: 1 start bit, 7 Data bits, n Stop bit This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: In 7-bits data length mode, the Smartcard mode, LIN master mode and Auto baud rate (0x7F and 0x55 frames detection) are not supported..
Bit 29: FIFO mode enable This bit is set and cleared by software. This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: FIFO mode can be used on standard UART communication, in SPI master/slave mode and in Smartcard modes only. It must not be enabled in IrDA and LIN modes..
Allowed values:
0x0: B_0x0: FIFO mode is disabled.
0x1: B_0x1: FIFO mode is enabled.
Control register 1
Offset: 0x0, reset: 0x0000, access: read-write
20/24 fields covered.
Bit 0: USART enable When this bit is cleared, the USART prescalers and outputs are stopped immediately, and all current operations are discarded. The USART configuration is kept, but all the USART_ISR status flags are reset. This bit is set and cleared by software. Note: To enter low-power mode without generating errors on the line, the TE bit must be previously reset and the software must wait for the TC bit in the USART_ISR to be set before resetting the UE bit. The DMA requests are also reset when UE = 0 so the DMA channel must be disabled before resetting the UE bit. In Smartcard mode, (SCEN = 1), the SCLK is always available when CLKEN = 1, regardless of the UE bit value..
Allowed values:
0x0: B_0x0: USART prescaler and outputs disabled, low-power mode
0x1: B_0x1: USART enabled
Bit 1: USART enable in low-power mode When this bit is cleared, the USART cannot wake up the MCU from low-power mode. When this bit is set, the USART can wake up the MCU from low-power mode. This bit is set and cleared by software. Note: It is recommended to set the UESM bit just before entering low-power mode and clear it when exit from low-power mode. If the USART does not support the wakeup from Stop feature, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: USART not able to wake up the MCU from low-power mode.
0x1: B_0x1: USART able to wake up the MCU from low-power mode.
Bit 3: Transmitter enable This bit enables the transmitter. It is set and cleared by software. Note: During transmission, a low pulse on the TE bit ('0â followed by '1â) sends a preamble (idle line) after the current word, except in Smartcard mode. In order to generate an idle character, the TE must not be immediately written to '1â. To ensure the required duration, the software can poll the TEACK bit in the USART_ISR register. In Smartcard mode, when TE is set, there is a 1 bit-time delay before the transmission starts..
Allowed values:
0x0: B_0x0: Transmitter is disabled
0x1: B_0x1: Transmitter is enabled
Bit 9: Parity selection This bit selects the odd or even parity when the parity generation/detection is enabled (PCE bit set). It is set and cleared by software. The parity is selected after the current byte. This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: Even parity
0x1: B_0x1: Odd parity
Bit 10: Parity control enable This bit selects the hardware parity control (generation and detection). When the parity control is enabled, the computed parity is inserted at the MSB position (9th bit if MÂ =Â 1; 8th bit if MÂ =Â 0) and the parity is checked on the received data. This bit is set and cleared by software. Once it is set, PCE is active after the current byte (in reception and in transmission). This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: Parity control disabled
0x1: B_0x1: Parity control enabled
Bit 13: Mute mode enable This bit enables the USART Mute mode function. When set, the USART can switch between active and Mute mode, as defined by the WAKE bit. It is set and cleared by software..
Allowed values:
0x0: B_0x0: Receiver in active mode permanently
0x1: B_0x1: Receiver can switch between Mute mode and active mode.
Bits 16-20: Driver Enable deassertion time This 5-bit value defines the time between the end of the last stop bit, in a transmitted message, and the de-activation of the DE (Driver Enable) signal. It is expressed in sample time units (1/8 or 1/16 bit time, depending on the oversampling rate). If the USART_TDR register is written during the DEDT time, the new data is transmitted only when the DEDT and DEAT times have both elapsed. This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If the Driver Enable feature is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Bits 21-25: Driver Enable assertion time This 5-bit value defines the time between the activation of the DE (Driver Enable) signal and the beginning of the start bit. It is expressed in sample time units (1/8 or 1/16 bit time, depending on the oversampling rate). This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If the Driver Enable feature is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Bit 26: Receiver timeout interrupt enable This bit is set and cleared by software. Note: If the USART does not support the Receiver timeout feature, this bit is reserved and must be kept at reset value. ..
Allowed values:
0x0: B_0x0: Interrupt inhibited
0x1: B_0x1: USART interrupt generated when the RTOF bit is set in the USART_ISR register.
Bit 27: End of Block interrupt enable This bit is set and cleared by software. Note: If the USART does not support Smartcard mode, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Interrupt inhibited
0x1: B_0x1: USART interrupt generated when the EOBF flag is set in the USART_ISR register
Bit 28: Word length This bit must be used in conjunction with bit 12 (M0) to determine the word length. It is set or cleared by software. M[1:0] = '00â: 1 start bit, 8 Data bits, n Stop bit M[1:0] = '01â: 1 start bit, 9 Data bits, n Stop bit M[1:0] = '10â: 1 start bit, 7 Data bits, n Stop bit This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: In 7-bits data length mode, the Smartcard mode, LIN master mode and Auto baud rate (0x7F and 0x55 frames detection) are not supported..
Bit 29: FIFO mode enable This bit is set and cleared by software. This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: FIFO mode can be used on standard UART communication, in SPI master/slave mode and in Smartcard modes only. It must not be enabled in IrDA and LIN modes..
Allowed values:
0x0: B_0x0: FIFO mode is disabled.
0x1: B_0x1: FIFO mode is enabled.
Control register 2
Offset: 0x4, reset: 0x0000, access: read-write
19/20 fields covered.
Bit 3: When the DIS_NSS bit is set, the NSS pin input is ignored. Note: When SPI slave mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: SPI slave selection depends on NSS input pin.
0x1: B_0x1: SPI slave is always selected and NSS input pin is ignored.
Bit 4: 7-bit Address Detection/4-bit Address Detection This bit is for selection between 4-bit address detection or 7-bit address detection. This bit can only be written when the USART is disabled (UEÂ =Â 0) Note: In 7-bit and 9-bit data modes, the address detection is done on 6-bit and 8-bit address (ADD[5:0] and ADD[7:0]) respectively..
Allowed values:
0x0: B_0x0: 4-bit address detection
0x1: B_0x1: 7-bit address detection (in 8-bit data mode)
Bit 5: LIN break detection length This bit is for selection between 11 bit or 10 bit break detection. This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If LIN mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: 10-bit break detection
0x1: B_0x1: 11-bit break detection
Bit 6: LIN break detection interrupt enable Break interrupt mask (break detection using break delimiter). Note: If LIN mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Interrupt is inhibited
0x1: B_0x1: An interrupt is generated whenever LBDF = 1 in the USART_ISR register
Bit 8: Last bit clock pulse This bit is used to select whether the clock pulse associated with the last data bit transmitted (MSB) has to be output on the SCLK pin in synchronous mode. The last bit is the 7th or 8th or 9th data bit transmitted depending on the 7 or 8 or 9 bit format selected by the M bit in the USART_CR1 register. This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If synchronous mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: The clock pulse of the last data bit is not output to the SCLK pin
0x1: B_0x1: The clock pulse of the last data bit is output to the SCLK pin
Bit 9: Clock phase This bit is used to select the phase of the clock output on the SCLK pin in synchronous mode. It works in conjunction with the CPOL bit to produce the desired clock/data relationship (see and ) This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If synchronous mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: The first clock transition is the first data capture edge
0x1: B_0x1: The second clock transition is the first data capture edge
Bit 10: Clock polarity This bit enables the user to select the polarity of the clock output on the SCLK pin in synchronous mode. It works in conjunction with the CPHA bit to produce the desired clock/data relationship This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If synchronous mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Steady low value on SCLK pin outside transmission window
0x1: B_0x1: Steady high value on SCLK pin outside transmission window
Bit 11: Clock enable This bit enables the user to enable the SCLK pin. This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If neither synchronous mode nor Smartcard mode is supported, this bit is reserved and must be kept at reset value. Refer to . In Smartcard mode, in order to provide correctly the SCLK clock to the smartcard, the steps below must be respected: UE = 0 SCEN = 1 GTPR configuration CLKEN= 1 UE = 1.
Allowed values:
0x0: B_0x0: SCLK pin disabled
0x1: B_0x1: SCLK pin enabled
Bit 14: LIN mode enable This bit is set and cleared by software. The LIN mode enables the capability to send LIN synchronous breaks (13 low bits) using the SBKRQ bit in the USART_CR1 register, and to detect LIN Sync breaks. This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If the USART does not support LIN mode, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: LIN mode disabled
0x1: B_0x1: LIN mode enabled
Bit 15: Swap TX/RX pins This bit is set and cleared by software. This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: TX/RX pins are used as defined in standard pinout
0x1: B_0x1: The TX and RX pins functions are swapped. This enables to work in the case of a cross-wired connection to another UART.
Bit 16: RX pin active level inversion This bit is set and cleared by software. This enables the use of an external inverter on the RX line. This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: RX pin signal works using the standard logic levels (VDD =1/idle, Gnd = 0/mark)
0x1: B_0x1: RX pin signal values are inverted (VDD =0/mark, Gnd = 1/idle).
Bit 17: TX pin active level inversion This bit is set and cleared by software. This enables the use of an external inverter on the TX line. This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: TX pin signal works using the standard logic levels (VDD =1/idle, Gnd = 0/mark)
0x1: B_0x1: TX pin signal values are inverted (VDD =0/mark, Gnd = 1/idle).
Bit 18: Binary data inversion This bit is set and cleared by software. This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: Logical data from the data register are send/received in positive/direct logic. (1 = H, 0 = L)
0x1: B_0x1: Logical data from the data register are send/received in negative/inverse logic. (1 = L, 0 = H). The parity bit is also inverted.
Bit 19: Most significant bit first This bit is set and cleared by software. This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: data is transmitted/received with data bit 0 first, following the start bit.
0x1: B_0x1: data is transmitted/received with the MSB (bit 7/8) first, following the start bit.
Bit 20: Auto baud rate enable This bit is set and cleared by software. Note: If the USART does not support the auto baud rate feature, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Auto baud rate detection is disabled.
0x1: B_0x1: Auto baud rate detection is enabled.
Bits 21-22: Auto baud rate mode These bits are set and cleared by software. This bitfield can only be written when ABREN = 0 or the USART is disabled (UEÂ =Â 0). Note: If DATAINVÂ =Â 1 and/or MSBFIRSTÂ =Â 1 the patterns must be the same on the line, for example 0xAA for MSBFIRST) If the USART does not support the auto baud rate feature, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Measurement of the start bit is used to detect the baud rate.
0x1: B_0x1: Falling edge to falling edge measurement (the received frame must start with a single bit = 1 and Frame = Start10xxxxxx)
0x2: B_0x2: 0x7F frame detection.
0x3: B_0x3: 0x55 frame detection
Bit 23: Receiver timeout enable This bit is set and cleared by software. When this feature is enabled, the RTOF flag in the USART_ISR register is set if the RX line is idle (no reception) for the duration programmed in the RTOR (receiver timeout register). Note: If the USART does not support the Receiver timeout feature, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Receiver timeout feature disabled.
0x1: B_0x1: Receiver timeout feature enabled.
Bits 24-31: Address of the USART node ADD[7:4]: These bits give the address of the USART node or a character code to be recognized. They are used to wake up the MCU with 7-bit address mark detection in multiprocessor communication during Mute mode or low-power mode. The MSB of the character sent by the transmitter should be equal to 1. They can also be used for character detection during normal reception, Mute mode inactive (for example, end of block detection in ModBus protocol). In this case, the whole received character (8-bit) is compared to the ADD[7:0] value and CMF flag is set on match. These bits can only be written when reception is disabled (RE = 0) or the USART is disabled (UEÂ =Â 0). ADD[3:0]: These bits give the address of the USART node or a character code to be recognized. They are used for wakeup with address mark detection, in multiprocessor communication during Mute mode or low-power mode. These bits can only be written when reception is disabled (RE = 0) or the USART is disabled (UEÂ =Â 0)..
Control register 3
Offset: 0x8, reset: 0x0000, access: read-write
24/24 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
TXFTCFG
rw |
RXFTIE
rw |
RXFTCFG
rw |
TCBGTIE
rw |
TXFTIE
rw |
WUFIE
rw |
WUS
rw |
SCARCNT
rw |
||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
DEP
rw |
DEM
rw |
DDRE
rw |
OVRDIS
rw |
ONEBIT
rw |
CTSIE
rw |
CTSE
rw |
RTSE
rw |
DMAT
rw |
DMAR
rw |
SCEN
rw |
NACK
rw |
HDSEL
rw |
IRLP
rw |
IREN
rw |
EIE
rw |
Bit 0: Error interrupt enable Error Interrupt Enable Bit is required to enable interrupt generation in case of a framing error, overrun error noise flag or SPI slave underrun error (FEÂ =Â 1 or OREÂ =Â 1 or NEÂ =Â 1 or UDR = 1 in the USART_ISR register)..
Allowed values:
0x0: B_0x0: Interrupt inhibited
0x1: B_0x1: interrupt generated when FE = 1 or ORE = 1 or NE = 1 or UDR = 1 (in SPI slave mode) in the USART_ISR register.
Bit 1: IrDA mode enable This bit is set and cleared by software. This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If IrDA mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: IrDA disabled
0x1: B_0x1: IrDA enabled
Bit 2: IrDA low-power This bit is used for selecting between normal and low-power IrDA modes This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If IrDA mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Normal mode
0x1: B_0x1: Low-power mode
Bit 4: Smartcard NACK enable This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If the USART does not support Smartcard mode, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: NACK transmission in case of parity error is disabled
0x1: B_0x1: NACK transmission during parity error is enabled
Bit 5: Smartcard mode enable This bit is used for enabling Smartcard mode. This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If the USART does not support Smartcard mode, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Smartcard Mode disabled
0x1: B_0x1: Smartcard Mode enabled
Bit 8: RTS enable This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If the hardware flow control feature is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: RTS hardware flow control disabled
0x1: B_0x1: RTS output enabled, data is only requested when there is space in the receive buffer. The transmission of data is expected to cease after the current character has been transmitted. The nRTS output is asserted (pulled to 0) when data can be received.
Bit 9: CTS enable This bit can only be written when the USART is disabled (UEÂ =Â 0) Note: If the hardware flow control feature is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: CTS hardware flow control disabled
0x1: B_0x1: CTS mode enabled, data is only transmitted when the nCTS input is asserted (tied to 0). If the nCTS input is deasserted while data is being transmitted, then the transmission is completed before stopping. If data is written into the data register while nCTS is asserted, the transmission is postponed until nCTS is asserted.
Bit 11: One sample bit method enable This bit enables the user to select the sample method. When the one sample bit method is selected the noise detection flag (NE) is disabled. This bit can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: Three sample bit method
0x1: B_0x1: One sample bit method
Bit 12: Overrun Disable This bit is used to disable the receive overrun detection. the ORE flag is not set and the new received data overwrites the previous content of the USART_RDR register. When FIFO mode is enabled, the RXFIFO is bypassed and data is written directly in USART_RDR register. Even when FIFO management is enabled, the RXNE flag is to be used. This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: This control bit enables checking the communication flow w/o reading the data.
Allowed values:
0x0: B_0x0: Overrun Error Flag, ORE, is set when received data is not read before receiving new data.
0x1: B_0x1: Overrun functionality is disabled. If new data is received while the RXNE flag is still set
Bit 13: DMA Disable on Reception Error This bit can only be written when the USART is disabled (UE=0). Note: The reception errors are: parity error, framing error or noise error..
Allowed values:
0x0: B_0x0: DMA is not disabled in case of reception error. The corresponding error flag is set but RXNE is kept 0 preventing from overrun. As a consequence, the DMA request is not asserted, so the erroneous data is not transferred (no DMA request), but next correct received data is transferred (used for Smartcard mode).
0x1: B_0x1: DMA is disabled following a reception error. The corresponding error flag is set, as well as RXNE. The DMA request is masked until the error flag is cleared. This means that the software must first disable the DMA request (DMAR = 0) or clear RXNE/RXFNE is case FIFO mode is enabled) before clearing the error flag.
Bit 14: Driver enable mode This bit enables the user to activate the external transceiver control, through the DE signal. This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If the Driver Enable feature is not supported, this bit is reserved and must be kept at reset value. ..
Allowed values:
0x0: B_0x0: DE function is disabled.
0x1: B_0x1: DE function is enabled. The DE signal is output on the RTS pin.
Bit 15: Driver enable polarity selection This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If the Driver Enable feature is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: DE signal is active high.
0x1: B_0x1: DE signal is active low.
Bits 17-19: Smartcard auto-retry count This bitfield specifies the number of retries for transmission and reception in Smartcard mode. In transmission mode, it specifies the number of automatic retransmission retries, before generating a transmission error (FE bit set). In reception mode, it specifies the number or erroneous reception trials, before generating a reception error (RXNE/RXFNE and PE bits set). This bitfield must be programmed only when the USART is disabled (UEÂ =Â 0). When the USART is enabled (UEÂ =Â 1), this bitfield may only be written to 0x0, in order to stop retransmission. Note: If Smartcard mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: retransmission disabled - No automatic retransmission in transmit mode.
0x1: B_0x1: number of automatic retransmission attempts (before signaling error)
0x2: B_0x2: number of automatic retransmission attempts (before signaling error)
0x3: B_0x3: number of automatic retransmission attempts (before signaling error)
0x4: B_0x4: number of automatic retransmission attempts (before signaling error)
0x5: B_0x5: number of automatic retransmission attempts (before signaling error)
0x6: B_0x6: number of automatic retransmission attempts (before signaling error)
0x7: B_0x7: number of automatic retransmission attempts (before signaling error)
Bits 20-21: Wakeup from low-power mode interrupt flag selection This bitfield specifies the event which activates the WUF (Wakeup from low-power mode flag). This bitfield can only be written when the USART is disabled (UE = 0). If the USART does not support the wakeup from Stop feature, this bit is reserved and must be kept at reset value. Refer to page 835..
Allowed values:
0x0: B_0x0: WUF active on address match (as defined by ADD[7:0] and ADDM7)
0x2: B_0x2: WUF active on start bit detection
0x3: B_0x3: WUF active on RXNE/RXFNE.
Bit 22: Wakeup from low-power mode interrupt enable This bit is set and cleared by software. Note: WUFIE must be set before entering in low-power mode. If the USART does not support the wakeup from Stop feature, this bit is reserved and must be kept at reset value. Refer to page 835..
Allowed values:
0x0: B_0x0: Interrupt inhibited
0x1: B_0x1: USART interrupt generated whenever WUF = 1 in the USART_ISR register
Bit 24: Transmission Complete before guard time, interrupt enable This bit is set and cleared by software. Note: If the USART does not support the Smartcard mode, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Interrupt inhibited
0x1: B_0x1: USART interrupt generated whenever TCBGT=1 in the USART_ISR register
Bits 25-27: Receive FIFO threshold configuration Remaining combinations: Reserved.
Allowed values:
0x0: B_0x0: Receive FIFO reaches 1/8 of its depth
0x1: B_0x1: Receive FIFO reaches 1/4 of its depth
0x2: B_0x2: Receive FIFO reaches 1/2 of its depth
0x3: B_0x3: Receive FIFO reaches 3/4 of its depth
0x4: B_0x4: Receive FIFO reaches 7/8 of its depth
0x5: B_0x5: Receive FIFO becomes full
Bits 29-31: TXFIFO threshold configuration Remaining combinations: Reserved.
Allowed values:
0x0: B_0x0: TXFIFO reaches 1/8 of its depth
0x1: B_0x1: TXFIFO reaches 1/4 of its depth
0x2: B_0x2: TXFIFO reaches 1/2 of its depth
0x3: B_0x3: TXFIFO reaches 3/4 of its depth
0x4: B_0x4: TXFIFO reaches 7/8 of its depth
0x5: B_0x5: TXFIFO becomes empty
Baud rate register
Offset: 0xC, reset: 0x0000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
BRR
rw |
|||||||||||||||
Guard time and prescaler register
Offset: 0x10, reset: 0x0000, access: read-write
1/2 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
GT
rw |
PSC
rw |
||||||||||||||
Bits 0-7: Prescaler value In IrDA low-power and normal IrDA mode: PSC[7:0] = IrDA Normal and Low-Power baud rate PSC[7:0] is used to program the prescaler for dividing the USART source clock to achieve the low-power frequency: the source clock is divided by the value given in the register (8 significant bits): In Smartcard mode: PSC[4:0]Â =Â Prescaler value PSC[4:0] is used to program the prescaler for dividing the USART source clock to provide the Smartcard clock. The value given in the register (5 significant bits) is multiplied by 2 to give the division factor of the source clock frequency: ... 0010Â 0000: Divides the source clock by 32 (IrDA mode) ... 1111Â 1111: Divides the source clock by 255 (IrDA mode) This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: Bits [7:5] must be kept cleared if Smartcard mode is used. This bitfield is reserved and forced by hardware to '0â when the Smartcard and IrDA modes are not supported. Refer to ..
Allowed values:
0x0: B_0x0: Reserved - do not program this value
0x1: B_0x1: Divides the source clock by 1 (IrDA mode) / by 2 (Smarcard mode)
0x2: B_0x2: Divides the source clock by 2 (IrDA mode) / by 4 (Smartcard mode)
0x3: B_0x3: Divides the source clock by 3 (IrDA mode) / by 6 (Smartcard mode)
0x1F: B_0x1F: Divides the source clock by 31 (IrDA mode) / by 62 (Smartcard mode)
Bits 8-15: Guard time value This bitfield is used to program the Guard time value in terms of number of baud clock periods. This is used in Smartcard mode. The Transmission Complete flag is set after this guard time value. This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If Smartcard mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Receiver timeout register
Offset: 0x14, reset: 0x0000, access: read-write
0/2 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
BLEN
rw |
RTO
rw |
||||||||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
RTO
rw |
|||||||||||||||
Request register
Offset: 0x18, reset: 0x0000, access: write-only
0/5 fields covered.
Bit 0: Auto baud rate request Writing 1 to this bit resets the ABRF flag in the USART_ISR and requests an automatic baud rate measurement on the next received data frame. Note: If the USART does not support the auto baud rate feature, this bit is reserved and must be kept at reset value. Refer to ..
Bit 1: Send break request Writing 1 to this bit sets the SBKF flag and request to send a BREAK on the line, as soon as the transmit machine is available. Note: When the application needs to send the break character following all previously inserted data, including the ones not yet transmitted, the software should wait for the TXE flag assertion before setting the SBKRQ bit..
Bit 4: Transmit data flush request When FIFO mode is disabled, writing '1â to this bit sets the TXE flag. This enables to discard the transmit data. This bit must be used only in Smartcard mode, when data have not been sent due to errors (NACK) and the FE flag is active in the USART_ISR register. If the USART does not support Smartcard mode, this bit is reserved and must be kept at reset value. When FIFO is enabled, TXFRQ bit is set to flush the whole FIFO. This sets the TXFE flag (Transmit FIFO empty, bit 23 in the USART_ISR register). Flushing the Transmit FIFO is supported in both UART and Smartcard modes. Note: In FIFO mode, the TXFNF flag is reset during the flush request until TxFIFO is empty in order to ensure that no data are written in the data register..
Interrupt & status register
Offset: 0x1C, reset: 0x000000C0, access: read-only
24/24 fields covered.
Bit 0: Parity error This bit is set by hardware when a parity error occurs in receiver mode. It is cleared by software, writing 1 to the PECF in the USART_ICR register. An interrupt is generated if PEIE = 1 in the USART_CR1 register..
Allowed values:
0x0: B_0x0: No parity error
0x1: B_0x1: Parity error
Bit 1: Framing error This bit is set by hardware when a de-synchronization, excessive noise or a break character is detected. It is cleared by software, writing 1 to the FECF bit in the USART_ICR register. When transmitting data in Smartcard mode, this bit is set when the maximum number of transmit attempts is reached without success (the card NACKs the data frame). An interrupt is generated if EIEÂ =Â 1 in the USART_CR1 register..
Allowed values:
0x0: B_0x0: No Framing error is detected
0x1: B_0x1: Framing error or break character is detected
Bit 2: Noise detection flag This bit is set by hardware when noise is detected on a received frame. It is cleared by software, writing 1 to the NECF bit in the USART_ICR register. Note: This bit does not generate an interrupt as it appears at the same time as the RXNE bit which itself generates an interrupt. An interrupt is generated when the NE flag is set during multi buffer communication if the EIE bit is set. When the line is noise-free, the NE flag can be disabled by programming the ONEBIT bit to 1 to increase the USART tolerance to deviations (Refer to Tolerance of the USART receiver to clock deviation on page 861)..
Allowed values:
0x0: B_0x0: No noise is detected
0x1: B_0x1: Noise is detected
Bit 3: Overrun error This bit is set by hardware when the data currently being received in the shift register is ready to be transferred into the USART_RDR register while RXNEÂ =Â 1. It is cleared by a software, writing 1 to the ORECF, in the USART_ICR register. An interrupt is generated if RXNEIEÂ =Â 1 or EIE Â =Â 1 in the USART_CR1 register. Note: When this bit is set, the USART_RDR register content is not lost but the shift register is overwritten. An interrupt is generated if the ORE flag is set during multi buffer communication if the EIE bit is set. This bit is permanently forced to 0 (no overrun detection) when the bit OVRDIS is set in the USART_CR3 register..
Allowed values:
0x0: B_0x0: No overrun error
0x1: B_0x1: Overrun error is detected
Bit 4: Idle line detected This bit is set by hardware when an Idle Line is detected. An interrupt is generated if IDLEIEÂ =Â 1 in the USART_CR1 register. It is cleared by software, writing 1 to the IDLECF in the USART_ICR register. Note: The IDLE bit is not set again until the RXNE bit has been set (i.e. a new idle line occurs). If Mute mode is enabled (MMEÂ =Â 1), IDLE is set if the USART is not mute (RWUÂ =Â 0), whatever the Mute mode selected by the WAKE bit. If RWUÂ =Â 1, IDLE is not set..
Allowed values:
0x0: B_0x0: No Idle line is detected
0x1: B_0x1: Idle line is detected
Bit 5: Read data register not empty RXNE bit is set by hardware when the content of the USART_RDR shift register has been transferred to the USART_RDR register. It is cleared by reading from the USART_RDR register. The RXNE flag can also be cleared by writing 1 to the RXFRQ in the USART_RQR register. An interrupt is generated if RXNEIEÂ =Â 1 in the USART_CR1 register..
Allowed values:
0x0: B_0x0: Data is not received
0x1: B_0x1: Received data is ready to be read.
Bit 6: Transmission complete This bit indicates that the last data written in the USART_TDR has been transmitted out of the shift register. It is set by hardware when the transmission of a frame containing data is complete and when TXE is set. An interrupt is generated if TCIEÂ =Â 1 in the USART_CR1 register. TC bit is is cleared by software, by writing 1 to the TCCF in the USART_ICR register or by a write to the USART_TDR register. Note: If TE bit is reset and no transmission is on going, the TC bit is set immediately..
Allowed values:
0x0: B_0x0: Transmission is not complete
0x1: B_0x1: Transmission is complete
Bit 7: Transmit data register empty TXE is set by hardware when the content of the USART_TDR register has been transferred into the shift register. It is cleared by writing to the USART_TDR register. The TXE flag can also be set by writing 1 to the TXFRQ in the USART_RQR register, in order to discard the data (only in Smartcard T = 0 mode, in case of transmission failure). An interrupt is generated if the TXEIE bit  = 1 in the USART_CR1 register..
Allowed values:
0x0: B_0x0: Data register full
0x1: B_0x1: Data register not full
Bit 8: LIN break detection flag This bit is set by hardware when the LIN break is detected. It is cleared by software, by writing 1 to the LBDCF in the USART_ICR. An interrupt is generated if LBDIE = 1 in the USART_CR2 register. Note: If the USART does not support LIN mode, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: LIN Break not detected
0x1: B_0x1: LIN break detected
Bit 9: CTS interrupt flag This bit is set by hardware when the nCTS input toggles, if the CTSE bit is set. It is cleared by software, by writing 1 to the CTSCF bit in the USART_ICR register. An interrupt is generated if CTSIEÂ =Â 1 in the USART_CR3 register. Note: If the hardware flow control feature is not supported, this bit is reserved and kept at reset value..
Allowed values:
0x0: B_0x0: No change occurred on the nCTS status line
0x1: B_0x1: A change occurred on the nCTS status line
Bit 11: Receiver timeout This bit is set by hardware when the timeout value, programmed in the RTOR register has lapsed, without any communication. It is cleared by software, writing 1 to the RTOCF bit in the USART_ICR register. An interrupt is generated if RTOIEÂ =Â 1 in the USART_CR2 register. In Smartcard mode, the timeout corresponds to the CWT or BWT timings. Note: If a time equal to the value programmed in RTOR register separates 2 characters, RTOF is not set. If this time exceeds this value + 2 sample times (2/16 or 2/8, depending on the oversampling method), RTOF flag is set. The counter counts even if RE = 0 but RTOF is set only when RE = 1. If the timeout has already elapsed when RE is set, then RTOF is set. If the USART does not support the Receiver timeout feature, this bit is reserved and kept at reset value..
Allowed values:
0x0: B_0x0: Timeout value not reached
0x1: B_0x1: Timeout value reached without any data reception
Bit 12: End of block flag This bit is set by hardware when a complete block has been received (for example TÂ =Â 1 Smartcard mode). The detection is done when the number of received bytes (from the start of the block, including the prologue) is equal or greater than BLEN + 4. An interrupt is generated if the EOBIEÂ =Â 1 in the USART_CR2 register. It is cleared by software, writing 1 to the EOBCF in the USART_ICR register. Note: If Smartcard mode is not supported, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: End of Block not reached
0x1: B_0x1: End of Block (number of characters) reached
Bit 13: SPI slave underrun error flag In slave transmission mode, this flag is set when the first clock pulse for data transmission appears while the software has not yet loaded any value into USART_TDR. This flag is reset by setting UDRCF bit in the USART_ICR register. Note: If the USART does not support the SPI slave mode, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: No underrun error
0x1: B_0x1: underrun error
Bit 14: Auto baud rate error This bit is set by hardware if the baud rate measurement failed (baud rate out of range or character comparison failed) It is cleared by software, by writing 1 to the ABRRQ bit in the USART_CR3 register. Note: If the USART does not support the auto baud rate feature, this bit is reserved and kept at reset value..
Bit 15: Auto baud rate flag This bit is set by hardware when the automatic baud rate has been set (RXNE is also set, generating an interrupt if RXNEIE = 1) or when the auto baud rate operation was completed without success (ABREÂ =Â 1) (ABRE, RXNE and FE are also set in this case) It is cleared by software, in order to request a new auto baud rate detection, by writing 1 to the ABRRQ in the USART_RQR register. Note: If the USART does not support the auto baud rate feature, this bit is reserved and kept at reset value..
Bit 16: Busy flag This bit is set and reset by hardware. It is active when a communication is ongoing on the RX line (successful start bit detected). It is reset at the end of the reception (successful or not)..
Allowed values:
0x0: B_0x0: USART is idle (no reception)
0x1: B_0x1: Reception on going
Bit 17: Character match flag This bit is set by hardware, when a the character defined by ADD[7:0] is received. It is cleared by software, writing 1 to the CMCF in the USART_ICR register. An interrupt is generated if CMIEÂ =Â 1in the USART_CR1 register..
Allowed values:
0x0: B_0x0: No Character match detected
0x1: B_0x1: Character Match detected
Bit 18: Send break flag This bit indicates that a send break character was requested. It is set by software, by writing 1 to the SBKRQ bit in the USART_CR3 register. It is automatically reset by hardware during the stop bit of break transmission..
Allowed values:
0x0: B_0x0: Break character transmitted
0x1: B_0x1: Break character requested by setting SBKRQ bit in USART_RQR register
Bit 19: Receiver wakeup from Mute mode This bit indicates if the USART is in Mute mode. It is cleared/set by hardware when a wakeup/mute sequence is recognized. The Mute mode control sequence (address or IDLE) is selected by the WAKE bit in the USART_CR1 register. When wakeup on IDLE mode is selected, this bit can only be set by software, writing 1 to the MMRQ bit in the USART_RQR register. Note: If the USART does not support the wakeup from Stop feature, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Receiver in active mode
0x1: B_0x1: Receiver in Mute mode
Bit 20: Wakeup from low-power mode flag This bit is set by hardware, when a wakeup event is detected. The event is defined by the WUS bitfield. It is cleared by software, writing a 1 to the WUCF in the USART_ICR register. An interrupt is generated if WUFIEÂ =Â 1 in the USART_CR3 register. Note: When UESM is cleared, WUF flag is also cleared. If the USART does not support the wakeup from Stop feature, this bit is reserved and kept at reset value. Refer to ..
Bit 21: Transmit enable acknowledge flag This bit is set/reset by hardware, when the Transmit Enable value is taken into account by the USART. It can be used when an idle frame request is generated by writing TEÂ =Â 0, followed by TEÂ =Â 1 in the USART_CR1 register, in order to respect the TEÂ =Â 0 minimum period..
Bit 22: Receive enable acknowledge flag This bit is set/reset by hardware, when the Receive Enable value is taken into account by the USART. It can be used to verify that the USART is ready for reception before entering low-power mode. Note: If the USART does not support the wakeup from Stop feature, this bit is reserved and kept at reset value. Refer to ..
Bit 25: Transmission complete before guard time flag This bit is set when the last data written in the USART_TDR has been transmitted correctly out of the shift register. It is set by hardware in Smartcard mode, if the transmission of a frame containing data is complete and if the smartcard did not send back any NACK. An interrupt is generated if TCBGTIE = 1 in the USART_CR3 register. This bit is cleared by software, by writing 1 to the TCBGTCF in the USART_ICR register or by a write to the USART_TDR register. Note: If the USART does not support the Smartcard mode, this bit is reserved and kept at reset value. If the USART supports the Smartcard mode and the Smartcard mode is enabled, the TCBGT reset value is '1â. Refer to on page 835..
Allowed values:
0x0: B_0x0: Transmission is not complete or transmission is complete unsuccessfully (i.e. a NACK is received from the card)
0x1: B_0x1: Transmission is complete successfully (before Guard time completion and there is no NACK from the smart card).
Interrupt & status register
Offset: 0x1C, reset: 0x008000C0, access: read-only
28/28 fields covered.
Bit 0: Parity error This bit is set by hardware when a parity error occurs in receiver mode. It is cleared by software, writing 1 to the PECF in the USART_ICR register. An interrupt is generated if PEIE = 1 in the USART_CR1 register. Note: This error is associated with the character in the USART_RDR..
Allowed values:
0x0: B_0x0: No parity error
0x1: B_0x1: Parity error
Bit 1: Framing error This bit is set by hardware when a de-synchronization, excessive noise or a break character is detected. It is cleared by software, writing 1 to the FECF bit in the USART_ICR register. When transmitting data in Smartcard mode, this bit is set when the maximum number of transmit attempts is reached without success (the card NACKs the data frame). An interrupt is generated if EIEÂ =Â 1 in the USART_CR1 register. Note: This error is associated with the character in the USART_RDR..
Allowed values:
0x0: B_0x0: No Framing error is detected
0x1: B_0x1: Framing error or break character is detected
Bit 2: Noise detection flag This bit is set by hardware when noise is detected on a received frame. It is cleared by software, writing 1 to the NECF bit in the USART_ICR register. Note: This bit does not generate an interrupt as it appears at the same time as the RXFNE bit which itself generates an interrupt. An interrupt is generated when the NE flag is set during multi buffer communication if the EIE bit is set. When the line is noise-free, the NE flag can be disabled by programming the ONEBIT bit to 1 to increase the USART tolerance to deviations (Refer to Tolerance of the USART receiver to clock deviation on page 861). This error is associated with the character in the USART_RDR..
Allowed values:
0x0: B_0x0: No noise is detected
0x1: B_0x1: Noise is detected
Bit 3: Overrun error This bit is set by hardware when the data currently being received in the shift register is ready to be transferred into the USART_RDR register while RXFF = 1. It is cleared by a software, writing 1 to the ORECF, in the USART_ICR register. An interrupt is generated if RXFNEIEÂ =Â 1 or EIE = 1 in the USART_CR1 register. Note: When this bit is set, the USART_RDR register content is not lost but the shift register is overwritten. An interrupt is generated if the ORE flag is set during multi buffer communication if the EIE bit is set. This bit is permanently forced to 0 (no overrun detection) when the bit OVRDIS is set in the USART_CR3 register..
Allowed values:
0x0: B_0x0: No overrun error
0x1: B_0x1: Overrun error is detected
Bit 4: Idle line detected This bit is set by hardware when an Idle Line is detected. An interrupt is generated if IDLEIEÂ =Â 1 in the USART_CR1 register. It is cleared by software, writing 1 to the IDLECF in the USART_ICR register. Note: The IDLE bit is not set again until the RXFNE bit has been set (i.e. a new idle line occurs). If Mute mode is enabled (MMEÂ =Â 1), IDLE is set if the USART is not mute (RWUÂ =Â 0), whatever the Mute mode selected by the WAKE bit. If RWUÂ =Â 1, IDLE is not set..
Allowed values:
0x0: B_0x0: No Idle line is detected
0x1: B_0x1: Idle line is detected
Bit 5: RXFIFO not empty RXFNE bit is set by hardware when the RXFIFO is not empty, meaning that data can be read from the USART_RDR register. Every read operation from the USART_RDR frees a location in the RXFIFO. RXFNE is cleared when the RXFIFO is empty. The RXFNE flag can also be cleared by writing 1 to the RXFRQ in the USART_RQR register. An interrupt is generated if RXFNEIEÂ =Â 1 in the USART_CR1 register..
Allowed values:
0x0: B_0x0: Data is not received
0x1: B_0x1: Received data is ready to be read.
Bit 6: Transmission complete This bit indicates that the last data written in the USART_TDR has been transmitted out of the shift register. It is set by hardware when the transmission of a frame containing data is complete and when TXFE is set. An interrupt is generated if TCIEÂ =Â 1 in the USART_CR1 register. TC bit is is cleared by software, by writing 1 to the TCCF in the USART_ICR register or by a write to the USART_TDR register. Note: If TE bit is reset and no transmission is on going, the TC bit is immediately set..
Allowed values:
0x0: B_0x0: Transmission is not complete
0x1: B_0x1: Transmission is complete
Bit 7: TXFIFO not full TXFNF is set by hardware when TXFIFO is not full meaning that data can be written in the USART_TDR. Every write operation to the USART_TDR places the data in the TXFIFO. This flag remains set until the TXFIFO is full. When the TXFIFO is full, this flag is cleared indicating that data can not be written into the USART_TDR. An interrupt is generated if the TXFNFIE bit =1 in the USART_CR1 register. Note: The TXFNF is kept reset during the flush request until TXFIFO is empty. After sending the flush request (by setting TXFRQ bit), the flag TXFNF should be checked prior to writing in TXFIFO (TXFNF and TXFE are set at the same time). This bit is used during single buffer transmission..
Allowed values:
0x0: B_0x0: Transmit FIFO is full
0x1: B_0x1: Transmit FIFO is not full
Bit 8: LIN break detection flag This bit is set by hardware when the LIN break is detected. It is cleared by software, by writing 1 to the LBDCF in the USART_ICR. An interrupt is generated if LBDIE = 1 in the USART_CR2 register. Note: If the USART does not support LIN mode, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: LIN Break not detected
0x1: B_0x1: LIN break detected
Bit 9: CTS interrupt flag This bit is set by hardware when the nCTS input toggles, if the CTSE bit is set. It is cleared by software, by writing 1 to the CTSCF bit in the USART_ICR register. An interrupt is generated if CTSIEÂ =Â 1 in the USART_CR3 register. Note: If the hardware flow control feature is not supported, this bit is reserved and kept at reset value..
Allowed values:
0x0: B_0x0: No change occurred on the nCTS status line
0x1: B_0x1: A change occurred on the nCTS status line
Bit 11: Receiver timeout This bit is set by hardware when the timeout value, programmed in the RTOR register has lapsed, without any communication. It is cleared by software, writing 1 to the RTOCF bit in the USART_ICR register. An interrupt is generated if RTOIEÂ =Â 1 in the USART_CR2 register. In Smartcard mode, the timeout corresponds to the CWT or BWT timings. Note: If a time equal to the value programmed in RTOR register separates 2 characters, RTOF is not set. If this time exceeds this value + 2 sample times (2/16 or 2/8, depending on the oversampling method), RTOF flag is set. The counter counts even if RE = 0 but RTOF is set only when RE = 1. If the timeout has already elapsed when RE is set, then RTOF is set. If the USART does not support the Receiver timeout feature, this bit is reserved and kept at reset value..
Allowed values:
0x0: B_0x0: Timeout value not reached
0x1: B_0x1: Timeout value reached without any data reception
Bit 12: End of block flag This bit is set by hardware when a complete block has been received (for example TÂ =Â 1 Smartcard mode). The detection is done when the number of received bytes (from the start of the block, including the prologue) is equal or greater than BLEN + 4. An interrupt is generated if the EOBIEÂ =Â 1 in the USART_CR2 register. It is cleared by software, writing 1 to the EOBCF in the USART_ICR register. Note: If Smartcard mode is not supported, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: End of Block not reached
0x1: B_0x1: End of Block (number of characters) reached
Bit 13: SPI slave underrun error flag In slave transmission mode, this flag is set when the first clock pulse for data transmission appears while the software has not yet loaded any value into USART_TDR. This flag is reset by setting UDRCF bit in the USART_ICR register. Note: If the USART does not support the SPI slave mode, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: No underrun error
0x1: B_0x1: underrun error
Bit 14: Auto baud rate error This bit is set by hardware if the baud rate measurement failed (baud rate out of range or character comparison failed) It is cleared by software, by writing 1 to the ABRRQ bit in the USART_CR3 register. Note: If the USART does not support the auto baud rate feature, this bit is reserved and kept at reset value..
Bit 15: Auto baud rate flag This bit is set by hardware when the automatic baud rate has been set (RXFNE is also set, generating an interrupt if RXFNEIE = 1) or when the auto baud rate operation was completed without success (ABREÂ =Â 1) (ABRE, RXFNE and FE are also set in this case) It is cleared by software, in order to request a new auto baud rate detection, by writing 1 to the ABRRQ in the USART_RQR register. Note: If the USART does not support the auto baud rate feature, this bit is reserved and kept at reset value..
Bit 16: Busy flag This bit is set and reset by hardware. It is active when a communication is ongoing on the RX line (successful start bit detected). It is reset at the end of the reception (successful or not)..
Allowed values:
0x0: B_0x0: USART is idle (no reception)
0x1: B_0x1: Reception on going
Bit 17: Character match flag This bit is set by hardware, when a the character defined by ADD[7:0] is received. It is cleared by software, writing 1 to the CMCF in the USART_ICR register. An interrupt is generated if CMIEÂ =Â 1in the USART_CR1 register..
Allowed values:
0x0: B_0x0: No Character match detected
0x1: B_0x1: Character Match detected
Bit 18: Send break flag This bit indicates that a send break character was requested. It is set by software, by writing 1 to the SBKRQ bit in the USART_CR3 register. It is automatically reset by hardware during the stop bit of break transmission..
Allowed values:
0x0: B_0x0: Break character transmitted
0x1: B_0x1: Break character requested by setting SBKRQ bit in USART_RQR register
Bit 19: Receiver wakeup from Mute mode This bit indicates if the USART is in Mute mode. It is cleared/set by hardware when a wakeup/mute sequence is recognized. The Mute mode control sequence (address or IDLE) is selected by the WAKE bit in the USART_CR1 register. When wakeup on IDLE mode is selected, this bit can only be set by software, writing 1 to the MMRQ bit in the USART_RQR register. Note: If the USART does not support the wakeup from Stop feature, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Receiver in active mode
0x1: B_0x1: Receiver in Mute mode
Bit 20: Wakeup from low-power mode flag This bit is set by hardware, when a wakeup event is detected. The event is defined by the WUS bitfield. It is cleared by software, writing a 1 to the WUCF in the USART_ICR register. An interrupt is generated if WUFIEÂ =Â 1 in the USART_CR3 register. Note: When UESM is cleared, WUF flag is also cleared. If the USART does not support the wakeup from Stop feature, this bit is reserved and kept at reset value. Refer to ..
Bit 21: Transmit enable acknowledge flag This bit is set/reset by hardware, when the Transmit Enable value is taken into account by the USART. It can be used when an idle frame request is generated by writing TEÂ =Â 0, followed by TEÂ =Â 1 in the USART_CR1 register, in order to respect the TEÂ =Â 0 minimum period..
Bit 22: Receive enable acknowledge flag This bit is set/reset by hardware, when the Receive Enable value is taken into account by the USART. It can be used to verify that the USART is ready for reception before entering low-power mode. Note: If the USART does not support the wakeup from Stop feature, this bit is reserved and kept at reset value. Refer to ..
Bit 23: TXFIFO empty This bit is set by hardware when TXFIFO is empty. When the TXFIFO contains at least one data, this flag is cleared. The TXFE flag can also be set by writing 1 to the bit TXFRQ (bit 4) in the USART_RQR register. An interrupt is generated if the TXFEIE bit  = 1 (bit 30) in the USART_CR1 register..
Allowed values:
0x0: B_0x0: TXFIFO not empty.
0x1: B_0x1: TXFIFO empty.
Bit 24: RXFIFO full This bit is set by hardware when the number of received data corresponds to RXFIFO size + 1 (RXFIFO full + 1 data in the USART_RDR register. An interrupt is generated if the RXFFIE bit  = 1 in the USART_CR1 register..
Allowed values:
0x0: B_0x0: RXFIFO not full.
0x1: B_0x1: RXFIFO Full.
Bit 25: Transmission complete before guard time flag This bit is set when the last data written in the USART_TDR has been transmitted correctly out of the shift register. It is set by hardware in Smartcard mode, if the transmission of a frame containing data is complete and if the smartcard did not send back any NACK. An interrupt is generated if TCBGTIE = 1 in the USART_CR3 register. This bit is cleared by software, by writing 1 to the TCBGTCF in the USART_ICR register or by a write to the USART_TDR register. Note: If the USART does not support the Smartcard mode, this bit is reserved and kept at reset value. If the USART supports the Smartcard mode and the Smartcard mode is enabled, the TCBGT reset value is '1â. Refer to on page 835..
Allowed values:
0x0: B_0x0: Transmission is not complete or transmission is complete unsuccessfully (i.e. a NACK is received from the card)
0x1: B_0x1: Transmission is complete successfully (before Guard time completion and there is no NACK from the smart card).
Bit 26: RXFIFO threshold flag This bit is set by hardware when the threshold programmed in RXFTCFG in USART_CR3 register is reached. This means that there are (RXFTCFG - 1) data in the Receive FIFO and one data in the USART_RDR register. An interrupt is generated if the RXFTIE bit  = 1 (bit 27) in the USART_CR3 register. Note: When the RXFTCFG threshold is configured to '101â, RXFT flag is set if 16 data are available i.e. 15 data in the RXFIFO and 1 data in the USART_RDR. Consequently, the 17th received data does not cause an overrun error. The overrun error occurs after receiving the 18th data..
Allowed values:
0x0: B_0x0: Receive FIFO does not reach the programmed threshold.
0x1: B_0x1: Receive FIFO reached the programmed threshold.
Bit 27: TXFIFO threshold flag This bit is set by hardware when the TXFIFO reaches the threshold programmed in TXFTCFG of USART_CR3 register i.e. the TXFIFO contains TXFTCFG empty locations. An interrupt is generated if the TXFTIE bit  = 1 (bit 31) in the USART_CR3 register..
Allowed values:
0x0: B_0x0: TXFIFO does not reach the programmed threshold.
0x1: B_0x1: TXFIFO reached the programmed threshold.
Receive data register
Offset: 0x24, reset: 0x0000, access: read-only
1/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
RDR
r |
|||||||||||||||
Transmit data register
Offset: 0x28, reset: 0x0000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
TDR
rw |
|||||||||||||||
Prescaler register
Offset: 0x2C, reset: 0x0000, access: read-write
1/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
PRESCALER
rw |
|||||||||||||||
Bits 0-3: Clock prescaler The USART input clock can be divided by a prescaler factor: Remaining combinations: Reserved Note: When PRESCALER is programmed with a value different of the allowed ones, programmed prescaler value is 1011 i.e. input clock divided by 256..
Allowed values:
0x0: B_0x0: input clock not divided
0x1: B_0x1: input clock divided by 2
0x2: B_0x2: input clock divided by 4
0x3: B_0x3: input clock divided by 6
0x4: B_0x4: input clock divided by 8
0x5: B_0x5: input clock divided by 10
0x6: B_0x6: input clock divided by 12
0x7: B_0x7: input clock divided by 16
0x8: B_0x8: input clock divided by 32
0x9: B_0x9: input clock divided by 64
0xA: B_0xA: input clock divided by 128
0xB: B_0xB: input clock divided by 256
0x40004C00: Universal synchronous asynchronous receiver transmitter
136/170 fields covered. Toggle Registers
| Offset | Name | 31 |
30 |
29 |
28 |
27 |
26 |
25 |
24 |
23 |
22 |
21 |
20 |
19 |
18 |
17 |
16 |
15 |
14 |
13 |
12 |
11 |
10 |
9 |
8 |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x0 | CR1_FIFO_DISABLED | ||||||||||||||||||||||||||||||||
| 0x0 | CR1_FIFO_ENABLED | ||||||||||||||||||||||||||||||||
| 0x4 | CR2 | ||||||||||||||||||||||||||||||||
| 0x8 | CR3 | ||||||||||||||||||||||||||||||||
| 0xC | BRR | ||||||||||||||||||||||||||||||||
| 0x10 | GTPR | ||||||||||||||||||||||||||||||||
| 0x14 | RTOR | ||||||||||||||||||||||||||||||||
| 0x18 | RQR | ||||||||||||||||||||||||||||||||
| 0x1C | ISR_FIFO_DISABLED | ||||||||||||||||||||||||||||||||
| 0x1C | ISR_FIFO_ENABLED | ||||||||||||||||||||||||||||||||
| 0x20 | ICR | ||||||||||||||||||||||||||||||||
| 0x24 | RDR | ||||||||||||||||||||||||||||||||
| 0x28 | TDR | ||||||||||||||||||||||||||||||||
| 0x2C | PRESC | ||||||||||||||||||||||||||||||||
Control register 1
Offset: 0x0, reset: 0x0000, access: read-write
18/22 fields covered.
Bit 0: USART enable When this bit is cleared, the USART prescalers and outputs are stopped immediately, and all current operations are discarded. The USART configuration is kept, but all the USART_ISR status flags are reset. This bit is set and cleared by software. Note: To enter low-power mode without generating errors on the line, the TE bit must be previously reset and the software must wait for the TC bit in the USART_ISR to be set before resetting the UE bit. The DMA requests are also reset when UE = 0 so the DMA channel must be disabled before resetting the UE bit. In Smartcard mode, (SCEN = 1), the SCLK is always available when CLKEN = 1, regardless of the UE bit value..
Allowed values:
0x0: B_0x0: USART prescaler and outputs disabled, low-power mode
0x1: B_0x1: USART enabled
Bit 1: USART enable in low-power mode When this bit is cleared, the USART cannot wake up the MCU from low-power mode. When this bit is set, the USART can wake up the MCU from low-power mode. This bit is set and cleared by software. Note: It is recommended to set the UESM bit just before entering low-power mode and clear it when exit from low-power mode. If the USART does not support the wakeup from Stop feature, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: USART not able to wake up the MCU from low-power mode.
0x1: B_0x1: USART able to wake up the MCU from low-power mode.
Bit 3: Transmitter enable This bit enables the transmitter. It is set and cleared by software. Note: During transmission, a low pulse on the TE bit ('0â followed by '1â) sends a preamble (idle line) after the current word, except in Smartcard mode. In order to generate an idle character, the TE must not be immediately written to '1â. To ensure the required duration, the software can poll the TEACK bit in the USART_ISR register. In Smartcard mode, when TE is set, there is a 1 bit-time delay before the transmission starts..
Allowed values:
0x0: B_0x0: Transmitter is disabled
0x1: B_0x1: Transmitter is enabled
Bit 9: Parity selection This bit selects the odd or even parity when the parity generation/detection is enabled (PCE bit set). It is set and cleared by software. The parity is selected after the current byte. This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: Even parity
0x1: B_0x1: Odd parity
Bit 10: Parity control enable This bit selects the hardware parity control (generation and detection). When the parity control is enabled, the computed parity is inserted at the MSB position (9th bit if MÂ =Â 1; 8th bit if MÂ =Â 0) and the parity is checked on the received data. This bit is set and cleared by software. Once it is set, PCE is active after the current byte (in reception and in transmission). This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: Parity control disabled
0x1: B_0x1: Parity control enabled
Bit 13: Mute mode enable This bit enables the USART Mute mode function. When set, the USART can switch between active and Mute mode, as defined by the WAKE bit. It is set and cleared by software..
Allowed values:
0x0: B_0x0: Receiver in active mode permanently
0x1: B_0x1: Receiver can switch between Mute mode and active mode.
Bits 16-20: Driver Enable deassertion time This 5-bit value defines the time between the end of the last stop bit, in a transmitted message, and the de-activation of the DE (Driver Enable) signal. It is expressed in sample time units (1/8 or 1/16 bit time, depending on the oversampling rate). If the USART_TDR register is written during the DEDT time, the new data is transmitted only when the DEDT and DEAT times have both elapsed. This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If the Driver Enable feature is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Bits 21-25: Driver Enable assertion time This 5-bit value defines the time between the activation of the DE (Driver Enable) signal and the beginning of the start bit. It is expressed in sample time units (1/8 or 1/16 bit time, depending on the oversampling rate). This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If the Driver Enable feature is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Bit 26: Receiver timeout interrupt enable This bit is set and cleared by software. Note: If the USART does not support the Receiver timeout feature, this bit is reserved and must be kept at reset value. ..
Allowed values:
0x0: B_0x0: Interrupt inhibited
0x1: B_0x1: USART interrupt generated when the RTOF bit is set in the USART_ISR register.
Bit 27: End of Block interrupt enable This bit is set and cleared by software. Note: If the USART does not support Smartcard mode, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Interrupt inhibited
0x1: B_0x1: USART interrupt generated when the EOBF flag is set in the USART_ISR register
Bit 28: Word length This bit must be used in conjunction with bit 12 (M0) to determine the word length. It is set or cleared by software. M[1:0] = '00â: 1 start bit, 8 Data bits, n Stop bit M[1:0] = '01â: 1 start bit, 9 Data bits, n Stop bit M[1:0] = '10â: 1 start bit, 7 Data bits, n Stop bit This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: In 7-bits data length mode, the Smartcard mode, LIN master mode and Auto baud rate (0x7F and 0x55 frames detection) are not supported..
Bit 29: FIFO mode enable This bit is set and cleared by software. This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: FIFO mode can be used on standard UART communication, in SPI master/slave mode and in Smartcard modes only. It must not be enabled in IrDA and LIN modes..
Allowed values:
0x0: B_0x0: FIFO mode is disabled.
0x1: B_0x1: FIFO mode is enabled.
Control register 1
Offset: 0x0, reset: 0x0000, access: read-write
20/24 fields covered.
Bit 0: USART enable When this bit is cleared, the USART prescalers and outputs are stopped immediately, and all current operations are discarded. The USART configuration is kept, but all the USART_ISR status flags are reset. This bit is set and cleared by software. Note: To enter low-power mode without generating errors on the line, the TE bit must be previously reset and the software must wait for the TC bit in the USART_ISR to be set before resetting the UE bit. The DMA requests are also reset when UE = 0 so the DMA channel must be disabled before resetting the UE bit. In Smartcard mode, (SCEN = 1), the SCLK is always available when CLKEN = 1, regardless of the UE bit value..
Allowed values:
0x0: B_0x0: USART prescaler and outputs disabled, low-power mode
0x1: B_0x1: USART enabled
Bit 1: USART enable in low-power mode When this bit is cleared, the USART cannot wake up the MCU from low-power mode. When this bit is set, the USART can wake up the MCU from low-power mode. This bit is set and cleared by software. Note: It is recommended to set the UESM bit just before entering low-power mode and clear it when exit from low-power mode. If the USART does not support the wakeup from Stop feature, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: USART not able to wake up the MCU from low-power mode.
0x1: B_0x1: USART able to wake up the MCU from low-power mode.
Bit 3: Transmitter enable This bit enables the transmitter. It is set and cleared by software. Note: During transmission, a low pulse on the TE bit ('0â followed by '1â) sends a preamble (idle line) after the current word, except in Smartcard mode. In order to generate an idle character, the TE must not be immediately written to '1â. To ensure the required duration, the software can poll the TEACK bit in the USART_ISR register. In Smartcard mode, when TE is set, there is a 1 bit-time delay before the transmission starts..
Allowed values:
0x0: B_0x0: Transmitter is disabled
0x1: B_0x1: Transmitter is enabled
Bit 9: Parity selection This bit selects the odd or even parity when the parity generation/detection is enabled (PCE bit set). It is set and cleared by software. The parity is selected after the current byte. This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: Even parity
0x1: B_0x1: Odd parity
Bit 10: Parity control enable This bit selects the hardware parity control (generation and detection). When the parity control is enabled, the computed parity is inserted at the MSB position (9th bit if MÂ =Â 1; 8th bit if MÂ =Â 0) and the parity is checked on the received data. This bit is set and cleared by software. Once it is set, PCE is active after the current byte (in reception and in transmission). This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: Parity control disabled
0x1: B_0x1: Parity control enabled
Bit 13: Mute mode enable This bit enables the USART Mute mode function. When set, the USART can switch between active and Mute mode, as defined by the WAKE bit. It is set and cleared by software..
Allowed values:
0x0: B_0x0: Receiver in active mode permanently
0x1: B_0x1: Receiver can switch between Mute mode and active mode.
Bits 16-20: Driver Enable deassertion time This 5-bit value defines the time between the end of the last stop bit, in a transmitted message, and the de-activation of the DE (Driver Enable) signal. It is expressed in sample time units (1/8 or 1/16 bit time, depending on the oversampling rate). If the USART_TDR register is written during the DEDT time, the new data is transmitted only when the DEDT and DEAT times have both elapsed. This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If the Driver Enable feature is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Bits 21-25: Driver Enable assertion time This 5-bit value defines the time between the activation of the DE (Driver Enable) signal and the beginning of the start bit. It is expressed in sample time units (1/8 or 1/16 bit time, depending on the oversampling rate). This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If the Driver Enable feature is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Bit 26: Receiver timeout interrupt enable This bit is set and cleared by software. Note: If the USART does not support the Receiver timeout feature, this bit is reserved and must be kept at reset value. ..
Allowed values:
0x0: B_0x0: Interrupt inhibited
0x1: B_0x1: USART interrupt generated when the RTOF bit is set in the USART_ISR register.
Bit 27: End of Block interrupt enable This bit is set and cleared by software. Note: If the USART does not support Smartcard mode, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Interrupt inhibited
0x1: B_0x1: USART interrupt generated when the EOBF flag is set in the USART_ISR register
Bit 28: Word length This bit must be used in conjunction with bit 12 (M0) to determine the word length. It is set or cleared by software. M[1:0] = '00â: 1 start bit, 8 Data bits, n Stop bit M[1:0] = '01â: 1 start bit, 9 Data bits, n Stop bit M[1:0] = '10â: 1 start bit, 7 Data bits, n Stop bit This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: In 7-bits data length mode, the Smartcard mode, LIN master mode and Auto baud rate (0x7F and 0x55 frames detection) are not supported..
Bit 29: FIFO mode enable This bit is set and cleared by software. This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: FIFO mode can be used on standard UART communication, in SPI master/slave mode and in Smartcard modes only. It must not be enabled in IrDA and LIN modes..
Allowed values:
0x0: B_0x0: FIFO mode is disabled.
0x1: B_0x1: FIFO mode is enabled.
Control register 2
Offset: 0x4, reset: 0x0000, access: read-write
19/20 fields covered.
Bit 3: When the DIS_NSS bit is set, the NSS pin input is ignored. Note: When SPI slave mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: SPI slave selection depends on NSS input pin.
0x1: B_0x1: SPI slave is always selected and NSS input pin is ignored.
Bit 4: 7-bit Address Detection/4-bit Address Detection This bit is for selection between 4-bit address detection or 7-bit address detection. This bit can only be written when the USART is disabled (UEÂ =Â 0) Note: In 7-bit and 9-bit data modes, the address detection is done on 6-bit and 8-bit address (ADD[5:0] and ADD[7:0]) respectively..
Allowed values:
0x0: B_0x0: 4-bit address detection
0x1: B_0x1: 7-bit address detection (in 8-bit data mode)
Bit 5: LIN break detection length This bit is for selection between 11 bit or 10 bit break detection. This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If LIN mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: 10-bit break detection
0x1: B_0x1: 11-bit break detection
Bit 6: LIN break detection interrupt enable Break interrupt mask (break detection using break delimiter). Note: If LIN mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Interrupt is inhibited
0x1: B_0x1: An interrupt is generated whenever LBDF = 1 in the USART_ISR register
Bit 8: Last bit clock pulse This bit is used to select whether the clock pulse associated with the last data bit transmitted (MSB) has to be output on the SCLK pin in synchronous mode. The last bit is the 7th or 8th or 9th data bit transmitted depending on the 7 or 8 or 9 bit format selected by the M bit in the USART_CR1 register. This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If synchronous mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: The clock pulse of the last data bit is not output to the SCLK pin
0x1: B_0x1: The clock pulse of the last data bit is output to the SCLK pin
Bit 9: Clock phase This bit is used to select the phase of the clock output on the SCLK pin in synchronous mode. It works in conjunction with the CPOL bit to produce the desired clock/data relationship (see and ) This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If synchronous mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: The first clock transition is the first data capture edge
0x1: B_0x1: The second clock transition is the first data capture edge
Bit 10: Clock polarity This bit enables the user to select the polarity of the clock output on the SCLK pin in synchronous mode. It works in conjunction with the CPHA bit to produce the desired clock/data relationship This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If synchronous mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Steady low value on SCLK pin outside transmission window
0x1: B_0x1: Steady high value on SCLK pin outside transmission window
Bit 11: Clock enable This bit enables the user to enable the SCLK pin. This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If neither synchronous mode nor Smartcard mode is supported, this bit is reserved and must be kept at reset value. Refer to . In Smartcard mode, in order to provide correctly the SCLK clock to the smartcard, the steps below must be respected: UE = 0 SCEN = 1 GTPR configuration CLKEN= 1 UE = 1.
Allowed values:
0x0: B_0x0: SCLK pin disabled
0x1: B_0x1: SCLK pin enabled
Bit 14: LIN mode enable This bit is set and cleared by software. The LIN mode enables the capability to send LIN synchronous breaks (13 low bits) using the SBKRQ bit in the USART_CR1 register, and to detect LIN Sync breaks. This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If the USART does not support LIN mode, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: LIN mode disabled
0x1: B_0x1: LIN mode enabled
Bit 15: Swap TX/RX pins This bit is set and cleared by software. This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: TX/RX pins are used as defined in standard pinout
0x1: B_0x1: The TX and RX pins functions are swapped. This enables to work in the case of a cross-wired connection to another UART.
Bit 16: RX pin active level inversion This bit is set and cleared by software. This enables the use of an external inverter on the RX line. This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: RX pin signal works using the standard logic levels (VDD =1/idle, Gnd = 0/mark)
0x1: B_0x1: RX pin signal values are inverted (VDD =0/mark, Gnd = 1/idle).
Bit 17: TX pin active level inversion This bit is set and cleared by software. This enables the use of an external inverter on the TX line. This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: TX pin signal works using the standard logic levels (VDD =1/idle, Gnd = 0/mark)
0x1: B_0x1: TX pin signal values are inverted (VDD =0/mark, Gnd = 1/idle).
Bit 18: Binary data inversion This bit is set and cleared by software. This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: Logical data from the data register are send/received in positive/direct logic. (1 = H, 0 = L)
0x1: B_0x1: Logical data from the data register are send/received in negative/inverse logic. (1 = L, 0 = H). The parity bit is also inverted.
Bit 19: Most significant bit first This bit is set and cleared by software. This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: data is transmitted/received with data bit 0 first, following the start bit.
0x1: B_0x1: data is transmitted/received with the MSB (bit 7/8) first, following the start bit.
Bit 20: Auto baud rate enable This bit is set and cleared by software. Note: If the USART does not support the auto baud rate feature, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Auto baud rate detection is disabled.
0x1: B_0x1: Auto baud rate detection is enabled.
Bits 21-22: Auto baud rate mode These bits are set and cleared by software. This bitfield can only be written when ABREN = 0 or the USART is disabled (UEÂ =Â 0). Note: If DATAINVÂ =Â 1 and/or MSBFIRSTÂ =Â 1 the patterns must be the same on the line, for example 0xAA for MSBFIRST) If the USART does not support the auto baud rate feature, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Measurement of the start bit is used to detect the baud rate.
0x1: B_0x1: Falling edge to falling edge measurement (the received frame must start with a single bit = 1 and Frame = Start10xxxxxx)
0x2: B_0x2: 0x7F frame detection.
0x3: B_0x3: 0x55 frame detection
Bit 23: Receiver timeout enable This bit is set and cleared by software. When this feature is enabled, the RTOF flag in the USART_ISR register is set if the RX line is idle (no reception) for the duration programmed in the RTOR (receiver timeout register). Note: If the USART does not support the Receiver timeout feature, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Receiver timeout feature disabled.
0x1: B_0x1: Receiver timeout feature enabled.
Bits 24-31: Address of the USART node ADD[7:4]: These bits give the address of the USART node or a character code to be recognized. They are used to wake up the MCU with 7-bit address mark detection in multiprocessor communication during Mute mode or low-power mode. The MSB of the character sent by the transmitter should be equal to 1. They can also be used for character detection during normal reception, Mute mode inactive (for example, end of block detection in ModBus protocol). In this case, the whole received character (8-bit) is compared to the ADD[7:0] value and CMF flag is set on match. These bits can only be written when reception is disabled (RE = 0) or the USART is disabled (UEÂ =Â 0). ADD[3:0]: These bits give the address of the USART node or a character code to be recognized. They are used for wakeup with address mark detection, in multiprocessor communication during Mute mode or low-power mode. These bits can only be written when reception is disabled (RE = 0) or the USART is disabled (UEÂ =Â 0)..
Control register 3
Offset: 0x8, reset: 0x0000, access: read-write
24/24 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
TXFTCFG
rw |
RXFTIE
rw |
RXFTCFG
rw |
TCBGTIE
rw |
TXFTIE
rw |
WUFIE
rw |
WUS
rw |
SCARCNT
rw |
||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
DEP
rw |
DEM
rw |
DDRE
rw |
OVRDIS
rw |
ONEBIT
rw |
CTSIE
rw |
CTSE
rw |
RTSE
rw |
DMAT
rw |
DMAR
rw |
SCEN
rw |
NACK
rw |
HDSEL
rw |
IRLP
rw |
IREN
rw |
EIE
rw |
Bit 0: Error interrupt enable Error Interrupt Enable Bit is required to enable interrupt generation in case of a framing error, overrun error noise flag or SPI slave underrun error (FEÂ =Â 1 or OREÂ =Â 1 or NEÂ =Â 1 or UDR = 1 in the USART_ISR register)..
Allowed values:
0x0: B_0x0: Interrupt inhibited
0x1: B_0x1: interrupt generated when FE = 1 or ORE = 1 or NE = 1 or UDR = 1 (in SPI slave mode) in the USART_ISR register.
Bit 1: IrDA mode enable This bit is set and cleared by software. This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If IrDA mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: IrDA disabled
0x1: B_0x1: IrDA enabled
Bit 2: IrDA low-power This bit is used for selecting between normal and low-power IrDA modes This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If IrDA mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Normal mode
0x1: B_0x1: Low-power mode
Bit 4: Smartcard NACK enable This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If the USART does not support Smartcard mode, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: NACK transmission in case of parity error is disabled
0x1: B_0x1: NACK transmission during parity error is enabled
Bit 5: Smartcard mode enable This bit is used for enabling Smartcard mode. This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If the USART does not support Smartcard mode, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Smartcard Mode disabled
0x1: B_0x1: Smartcard Mode enabled
Bit 8: RTS enable This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If the hardware flow control feature is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: RTS hardware flow control disabled
0x1: B_0x1: RTS output enabled, data is only requested when there is space in the receive buffer. The transmission of data is expected to cease after the current character has been transmitted. The nRTS output is asserted (pulled to 0) when data can be received.
Bit 9: CTS enable This bit can only be written when the USART is disabled (UEÂ =Â 0) Note: If the hardware flow control feature is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: CTS hardware flow control disabled
0x1: B_0x1: CTS mode enabled, data is only transmitted when the nCTS input is asserted (tied to 0). If the nCTS input is deasserted while data is being transmitted, then the transmission is completed before stopping. If data is written into the data register while nCTS is asserted, the transmission is postponed until nCTS is asserted.
Bit 11: One sample bit method enable This bit enables the user to select the sample method. When the one sample bit method is selected the noise detection flag (NE) is disabled. This bit can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: Three sample bit method
0x1: B_0x1: One sample bit method
Bit 12: Overrun Disable This bit is used to disable the receive overrun detection. the ORE flag is not set and the new received data overwrites the previous content of the USART_RDR register. When FIFO mode is enabled, the RXFIFO is bypassed and data is written directly in USART_RDR register. Even when FIFO management is enabled, the RXNE flag is to be used. This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: This control bit enables checking the communication flow w/o reading the data.
Allowed values:
0x0: B_0x0: Overrun Error Flag, ORE, is set when received data is not read before receiving new data.
0x1: B_0x1: Overrun functionality is disabled. If new data is received while the RXNE flag is still set
Bit 13: DMA Disable on Reception Error This bit can only be written when the USART is disabled (UE=0). Note: The reception errors are: parity error, framing error or noise error..
Allowed values:
0x0: B_0x0: DMA is not disabled in case of reception error. The corresponding error flag is set but RXNE is kept 0 preventing from overrun. As a consequence, the DMA request is not asserted, so the erroneous data is not transferred (no DMA request), but next correct received data is transferred (used for Smartcard mode).
0x1: B_0x1: DMA is disabled following a reception error. The corresponding error flag is set, as well as RXNE. The DMA request is masked until the error flag is cleared. This means that the software must first disable the DMA request (DMAR = 0) or clear RXNE/RXFNE is case FIFO mode is enabled) before clearing the error flag.
Bit 14: Driver enable mode This bit enables the user to activate the external transceiver control, through the DE signal. This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If the Driver Enable feature is not supported, this bit is reserved and must be kept at reset value. ..
Allowed values:
0x0: B_0x0: DE function is disabled.
0x1: B_0x1: DE function is enabled. The DE signal is output on the RTS pin.
Bit 15: Driver enable polarity selection This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If the Driver Enable feature is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: DE signal is active high.
0x1: B_0x1: DE signal is active low.
Bits 17-19: Smartcard auto-retry count This bitfield specifies the number of retries for transmission and reception in Smartcard mode. In transmission mode, it specifies the number of automatic retransmission retries, before generating a transmission error (FE bit set). In reception mode, it specifies the number or erroneous reception trials, before generating a reception error (RXNE/RXFNE and PE bits set). This bitfield must be programmed only when the USART is disabled (UEÂ =Â 0). When the USART is enabled (UEÂ =Â 1), this bitfield may only be written to 0x0, in order to stop retransmission. Note: If Smartcard mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: retransmission disabled - No automatic retransmission in transmit mode.
0x1: B_0x1: number of automatic retransmission attempts (before signaling error)
0x2: B_0x2: number of automatic retransmission attempts (before signaling error)
0x3: B_0x3: number of automatic retransmission attempts (before signaling error)
0x4: B_0x4: number of automatic retransmission attempts (before signaling error)
0x5: B_0x5: number of automatic retransmission attempts (before signaling error)
0x6: B_0x6: number of automatic retransmission attempts (before signaling error)
0x7: B_0x7: number of automatic retransmission attempts (before signaling error)
Bits 20-21: Wakeup from low-power mode interrupt flag selection This bitfield specifies the event which activates the WUF (Wakeup from low-power mode flag). This bitfield can only be written when the USART is disabled (UE = 0). If the USART does not support the wakeup from Stop feature, this bit is reserved and must be kept at reset value. Refer to page 835..
Allowed values:
0x0: B_0x0: WUF active on address match (as defined by ADD[7:0] and ADDM7)
0x2: B_0x2: WUF active on start bit detection
0x3: B_0x3: WUF active on RXNE/RXFNE.
Bit 22: Wakeup from low-power mode interrupt enable This bit is set and cleared by software. Note: WUFIE must be set before entering in low-power mode. If the USART does not support the wakeup from Stop feature, this bit is reserved and must be kept at reset value. Refer to page 835..
Allowed values:
0x0: B_0x0: Interrupt inhibited
0x1: B_0x1: USART interrupt generated whenever WUF = 1 in the USART_ISR register
Bit 24: Transmission Complete before guard time, interrupt enable This bit is set and cleared by software. Note: If the USART does not support the Smartcard mode, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Interrupt inhibited
0x1: B_0x1: USART interrupt generated whenever TCBGT=1 in the USART_ISR register
Bits 25-27: Receive FIFO threshold configuration Remaining combinations: Reserved.
Allowed values:
0x0: B_0x0: Receive FIFO reaches 1/8 of its depth
0x1: B_0x1: Receive FIFO reaches 1/4 of its depth
0x2: B_0x2: Receive FIFO reaches 1/2 of its depth
0x3: B_0x3: Receive FIFO reaches 3/4 of its depth
0x4: B_0x4: Receive FIFO reaches 7/8 of its depth
0x5: B_0x5: Receive FIFO becomes full
Bits 29-31: TXFIFO threshold configuration Remaining combinations: Reserved.
Allowed values:
0x0: B_0x0: TXFIFO reaches 1/8 of its depth
0x1: B_0x1: TXFIFO reaches 1/4 of its depth
0x2: B_0x2: TXFIFO reaches 1/2 of its depth
0x3: B_0x3: TXFIFO reaches 3/4 of its depth
0x4: B_0x4: TXFIFO reaches 7/8 of its depth
0x5: B_0x5: TXFIFO becomes empty
Baud rate register
Offset: 0xC, reset: 0x0000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
BRR
rw |
|||||||||||||||
Guard time and prescaler register
Offset: 0x10, reset: 0x0000, access: read-write
1/2 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
GT
rw |
PSC
rw |
||||||||||||||
Bits 0-7: Prescaler value In IrDA low-power and normal IrDA mode: PSC[7:0] = IrDA Normal and Low-Power baud rate PSC[7:0] is used to program the prescaler for dividing the USART source clock to achieve the low-power frequency: the source clock is divided by the value given in the register (8 significant bits): In Smartcard mode: PSC[4:0]Â =Â Prescaler value PSC[4:0] is used to program the prescaler for dividing the USART source clock to provide the Smartcard clock. The value given in the register (5 significant bits) is multiplied by 2 to give the division factor of the source clock frequency: ... 0010Â 0000: Divides the source clock by 32 (IrDA mode) ... 1111Â 1111: Divides the source clock by 255 (IrDA mode) This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: Bits [7:5] must be kept cleared if Smartcard mode is used. This bitfield is reserved and forced by hardware to '0â when the Smartcard and IrDA modes are not supported. Refer to ..
Allowed values:
0x0: B_0x0: Reserved - do not program this value
0x1: B_0x1: Divides the source clock by 1 (IrDA mode) / by 2 (Smarcard mode)
0x2: B_0x2: Divides the source clock by 2 (IrDA mode) / by 4 (Smartcard mode)
0x3: B_0x3: Divides the source clock by 3 (IrDA mode) / by 6 (Smartcard mode)
0x1F: B_0x1F: Divides the source clock by 31 (IrDA mode) / by 62 (Smartcard mode)
Bits 8-15: Guard time value This bitfield is used to program the Guard time value in terms of number of baud clock periods. This is used in Smartcard mode. The Transmission Complete flag is set after this guard time value. This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If Smartcard mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Receiver timeout register
Offset: 0x14, reset: 0x0000, access: read-write
0/2 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
BLEN
rw |
RTO
rw |
||||||||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
RTO
rw |
|||||||||||||||
Request register
Offset: 0x18, reset: 0x0000, access: write-only
0/5 fields covered.
Bit 0: Auto baud rate request Writing 1 to this bit resets the ABRF flag in the USART_ISR and requests an automatic baud rate measurement on the next received data frame. Note: If the USART does not support the auto baud rate feature, this bit is reserved and must be kept at reset value. Refer to ..
Bit 1: Send break request Writing 1 to this bit sets the SBKF flag and request to send a BREAK on the line, as soon as the transmit machine is available. Note: When the application needs to send the break character following all previously inserted data, including the ones not yet transmitted, the software should wait for the TXE flag assertion before setting the SBKRQ bit..
Bit 4: Transmit data flush request When FIFO mode is disabled, writing '1â to this bit sets the TXE flag. This enables to discard the transmit data. This bit must be used only in Smartcard mode, when data have not been sent due to errors (NACK) and the FE flag is active in the USART_ISR register. If the USART does not support Smartcard mode, this bit is reserved and must be kept at reset value. When FIFO is enabled, TXFRQ bit is set to flush the whole FIFO. This sets the TXFE flag (Transmit FIFO empty, bit 23 in the USART_ISR register). Flushing the Transmit FIFO is supported in both UART and Smartcard modes. Note: In FIFO mode, the TXFNF flag is reset during the flush request until TxFIFO is empty in order to ensure that no data are written in the data register..
Interrupt & status register
Offset: 0x1C, reset: 0x000000C0, access: read-only
24/24 fields covered.
Bit 0: Parity error This bit is set by hardware when a parity error occurs in receiver mode. It is cleared by software, writing 1 to the PECF in the USART_ICR register. An interrupt is generated if PEIE = 1 in the USART_CR1 register..
Allowed values:
0x0: B_0x0: No parity error
0x1: B_0x1: Parity error
Bit 1: Framing error This bit is set by hardware when a de-synchronization, excessive noise or a break character is detected. It is cleared by software, writing 1 to the FECF bit in the USART_ICR register. When transmitting data in Smartcard mode, this bit is set when the maximum number of transmit attempts is reached without success (the card NACKs the data frame). An interrupt is generated if EIEÂ =Â 1 in the USART_CR1 register..
Allowed values:
0x0: B_0x0: No Framing error is detected
0x1: B_0x1: Framing error or break character is detected
Bit 2: Noise detection flag This bit is set by hardware when noise is detected on a received frame. It is cleared by software, writing 1 to the NECF bit in the USART_ICR register. Note: This bit does not generate an interrupt as it appears at the same time as the RXNE bit which itself generates an interrupt. An interrupt is generated when the NE flag is set during multi buffer communication if the EIE bit is set. When the line is noise-free, the NE flag can be disabled by programming the ONEBIT bit to 1 to increase the USART tolerance to deviations (Refer to Tolerance of the USART receiver to clock deviation on page 861)..
Allowed values:
0x0: B_0x0: No noise is detected
0x1: B_0x1: Noise is detected
Bit 3: Overrun error This bit is set by hardware when the data currently being received in the shift register is ready to be transferred into the USART_RDR register while RXNEÂ =Â 1. It is cleared by a software, writing 1 to the ORECF, in the USART_ICR register. An interrupt is generated if RXNEIEÂ =Â 1 or EIE Â =Â 1 in the USART_CR1 register. Note: When this bit is set, the USART_RDR register content is not lost but the shift register is overwritten. An interrupt is generated if the ORE flag is set during multi buffer communication if the EIE bit is set. This bit is permanently forced to 0 (no overrun detection) when the bit OVRDIS is set in the USART_CR3 register..
Allowed values:
0x0: B_0x0: No overrun error
0x1: B_0x1: Overrun error is detected
Bit 4: Idle line detected This bit is set by hardware when an Idle Line is detected. An interrupt is generated if IDLEIEÂ =Â 1 in the USART_CR1 register. It is cleared by software, writing 1 to the IDLECF in the USART_ICR register. Note: The IDLE bit is not set again until the RXNE bit has been set (i.e. a new idle line occurs). If Mute mode is enabled (MMEÂ =Â 1), IDLE is set if the USART is not mute (RWUÂ =Â 0), whatever the Mute mode selected by the WAKE bit. If RWUÂ =Â 1, IDLE is not set..
Allowed values:
0x0: B_0x0: No Idle line is detected
0x1: B_0x1: Idle line is detected
Bit 5: Read data register not empty RXNE bit is set by hardware when the content of the USART_RDR shift register has been transferred to the USART_RDR register. It is cleared by reading from the USART_RDR register. The RXNE flag can also be cleared by writing 1 to the RXFRQ in the USART_RQR register. An interrupt is generated if RXNEIEÂ =Â 1 in the USART_CR1 register..
Allowed values:
0x0: B_0x0: Data is not received
0x1: B_0x1: Received data is ready to be read.
Bit 6: Transmission complete This bit indicates that the last data written in the USART_TDR has been transmitted out of the shift register. It is set by hardware when the transmission of a frame containing data is complete and when TXE is set. An interrupt is generated if TCIEÂ =Â 1 in the USART_CR1 register. TC bit is is cleared by software, by writing 1 to the TCCF in the USART_ICR register or by a write to the USART_TDR register. Note: If TE bit is reset and no transmission is on going, the TC bit is set immediately..
Allowed values:
0x0: B_0x0: Transmission is not complete
0x1: B_0x1: Transmission is complete
Bit 7: Transmit data register empty TXE is set by hardware when the content of the USART_TDR register has been transferred into the shift register. It is cleared by writing to the USART_TDR register. The TXE flag can also be set by writing 1 to the TXFRQ in the USART_RQR register, in order to discard the data (only in Smartcard T = 0 mode, in case of transmission failure). An interrupt is generated if the TXEIE bit  = 1 in the USART_CR1 register..
Allowed values:
0x0: B_0x0: Data register full
0x1: B_0x1: Data register not full
Bit 8: LIN break detection flag This bit is set by hardware when the LIN break is detected. It is cleared by software, by writing 1 to the LBDCF in the USART_ICR. An interrupt is generated if LBDIE = 1 in the USART_CR2 register. Note: If the USART does not support LIN mode, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: LIN Break not detected
0x1: B_0x1: LIN break detected
Bit 9: CTS interrupt flag This bit is set by hardware when the nCTS input toggles, if the CTSE bit is set. It is cleared by software, by writing 1 to the CTSCF bit in the USART_ICR register. An interrupt is generated if CTSIEÂ =Â 1 in the USART_CR3 register. Note: If the hardware flow control feature is not supported, this bit is reserved and kept at reset value..
Allowed values:
0x0: B_0x0: No change occurred on the nCTS status line
0x1: B_0x1: A change occurred on the nCTS status line
Bit 11: Receiver timeout This bit is set by hardware when the timeout value, programmed in the RTOR register has lapsed, without any communication. It is cleared by software, writing 1 to the RTOCF bit in the USART_ICR register. An interrupt is generated if RTOIEÂ =Â 1 in the USART_CR2 register. In Smartcard mode, the timeout corresponds to the CWT or BWT timings. Note: If a time equal to the value programmed in RTOR register separates 2 characters, RTOF is not set. If this time exceeds this value + 2 sample times (2/16 or 2/8, depending on the oversampling method), RTOF flag is set. The counter counts even if RE = 0 but RTOF is set only when RE = 1. If the timeout has already elapsed when RE is set, then RTOF is set. If the USART does not support the Receiver timeout feature, this bit is reserved and kept at reset value..
Allowed values:
0x0: B_0x0: Timeout value not reached
0x1: B_0x1: Timeout value reached without any data reception
Bit 12: End of block flag This bit is set by hardware when a complete block has been received (for example TÂ =Â 1 Smartcard mode). The detection is done when the number of received bytes (from the start of the block, including the prologue) is equal or greater than BLEN + 4. An interrupt is generated if the EOBIEÂ =Â 1 in the USART_CR2 register. It is cleared by software, writing 1 to the EOBCF in the USART_ICR register. Note: If Smartcard mode is not supported, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: End of Block not reached
0x1: B_0x1: End of Block (number of characters) reached
Bit 13: SPI slave underrun error flag In slave transmission mode, this flag is set when the first clock pulse for data transmission appears while the software has not yet loaded any value into USART_TDR. This flag is reset by setting UDRCF bit in the USART_ICR register. Note: If the USART does not support the SPI slave mode, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: No underrun error
0x1: B_0x1: underrun error
Bit 14: Auto baud rate error This bit is set by hardware if the baud rate measurement failed (baud rate out of range or character comparison failed) It is cleared by software, by writing 1 to the ABRRQ bit in the USART_CR3 register. Note: If the USART does not support the auto baud rate feature, this bit is reserved and kept at reset value..
Bit 15: Auto baud rate flag This bit is set by hardware when the automatic baud rate has been set (RXNE is also set, generating an interrupt if RXNEIE = 1) or when the auto baud rate operation was completed without success (ABREÂ =Â 1) (ABRE, RXNE and FE are also set in this case) It is cleared by software, in order to request a new auto baud rate detection, by writing 1 to the ABRRQ in the USART_RQR register. Note: If the USART does not support the auto baud rate feature, this bit is reserved and kept at reset value..
Bit 16: Busy flag This bit is set and reset by hardware. It is active when a communication is ongoing on the RX line (successful start bit detected). It is reset at the end of the reception (successful or not)..
Allowed values:
0x0: B_0x0: USART is idle (no reception)
0x1: B_0x1: Reception on going
Bit 17: Character match flag This bit is set by hardware, when a the character defined by ADD[7:0] is received. It is cleared by software, writing 1 to the CMCF in the USART_ICR register. An interrupt is generated if CMIEÂ =Â 1in the USART_CR1 register..
Allowed values:
0x0: B_0x0: No Character match detected
0x1: B_0x1: Character Match detected
Bit 18: Send break flag This bit indicates that a send break character was requested. It is set by software, by writing 1 to the SBKRQ bit in the USART_CR3 register. It is automatically reset by hardware during the stop bit of break transmission..
Allowed values:
0x0: B_0x0: Break character transmitted
0x1: B_0x1: Break character requested by setting SBKRQ bit in USART_RQR register
Bit 19: Receiver wakeup from Mute mode This bit indicates if the USART is in Mute mode. It is cleared/set by hardware when a wakeup/mute sequence is recognized. The Mute mode control sequence (address or IDLE) is selected by the WAKE bit in the USART_CR1 register. When wakeup on IDLE mode is selected, this bit can only be set by software, writing 1 to the MMRQ bit in the USART_RQR register. Note: If the USART does not support the wakeup from Stop feature, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Receiver in active mode
0x1: B_0x1: Receiver in Mute mode
Bit 20: Wakeup from low-power mode flag This bit is set by hardware, when a wakeup event is detected. The event is defined by the WUS bitfield. It is cleared by software, writing a 1 to the WUCF in the USART_ICR register. An interrupt is generated if WUFIEÂ =Â 1 in the USART_CR3 register. Note: When UESM is cleared, WUF flag is also cleared. If the USART does not support the wakeup from Stop feature, this bit is reserved and kept at reset value. Refer to ..
Bit 21: Transmit enable acknowledge flag This bit is set/reset by hardware, when the Transmit Enable value is taken into account by the USART. It can be used when an idle frame request is generated by writing TEÂ =Â 0, followed by TEÂ =Â 1 in the USART_CR1 register, in order to respect the TEÂ =Â 0 minimum period..
Bit 22: Receive enable acknowledge flag This bit is set/reset by hardware, when the Receive Enable value is taken into account by the USART. It can be used to verify that the USART is ready for reception before entering low-power mode. Note: If the USART does not support the wakeup from Stop feature, this bit is reserved and kept at reset value. Refer to ..
Bit 25: Transmission complete before guard time flag This bit is set when the last data written in the USART_TDR has been transmitted correctly out of the shift register. It is set by hardware in Smartcard mode, if the transmission of a frame containing data is complete and if the smartcard did not send back any NACK. An interrupt is generated if TCBGTIE = 1 in the USART_CR3 register. This bit is cleared by software, by writing 1 to the TCBGTCF in the USART_ICR register or by a write to the USART_TDR register. Note: If the USART does not support the Smartcard mode, this bit is reserved and kept at reset value. If the USART supports the Smartcard mode and the Smartcard mode is enabled, the TCBGT reset value is '1â. Refer to on page 835..
Allowed values:
0x0: B_0x0: Transmission is not complete or transmission is complete unsuccessfully (i.e. a NACK is received from the card)
0x1: B_0x1: Transmission is complete successfully (before Guard time completion and there is no NACK from the smart card).
Interrupt & status register
Offset: 0x1C, reset: 0x008000C0, access: read-only
28/28 fields covered.
Bit 0: Parity error This bit is set by hardware when a parity error occurs in receiver mode. It is cleared by software, writing 1 to the PECF in the USART_ICR register. An interrupt is generated if PEIE = 1 in the USART_CR1 register. Note: This error is associated with the character in the USART_RDR..
Allowed values:
0x0: B_0x0: No parity error
0x1: B_0x1: Parity error
Bit 1: Framing error This bit is set by hardware when a de-synchronization, excessive noise or a break character is detected. It is cleared by software, writing 1 to the FECF bit in the USART_ICR register. When transmitting data in Smartcard mode, this bit is set when the maximum number of transmit attempts is reached without success (the card NACKs the data frame). An interrupt is generated if EIEÂ =Â 1 in the USART_CR1 register. Note: This error is associated with the character in the USART_RDR..
Allowed values:
0x0: B_0x0: No Framing error is detected
0x1: B_0x1: Framing error or break character is detected
Bit 2: Noise detection flag This bit is set by hardware when noise is detected on a received frame. It is cleared by software, writing 1 to the NECF bit in the USART_ICR register. Note: This bit does not generate an interrupt as it appears at the same time as the RXFNE bit which itself generates an interrupt. An interrupt is generated when the NE flag is set during multi buffer communication if the EIE bit is set. When the line is noise-free, the NE flag can be disabled by programming the ONEBIT bit to 1 to increase the USART tolerance to deviations (Refer to Tolerance of the USART receiver to clock deviation on page 861). This error is associated with the character in the USART_RDR..
Allowed values:
0x0: B_0x0: No noise is detected
0x1: B_0x1: Noise is detected
Bit 3: Overrun error This bit is set by hardware when the data currently being received in the shift register is ready to be transferred into the USART_RDR register while RXFF = 1. It is cleared by a software, writing 1 to the ORECF, in the USART_ICR register. An interrupt is generated if RXFNEIEÂ =Â 1 or EIE = 1 in the USART_CR1 register. Note: When this bit is set, the USART_RDR register content is not lost but the shift register is overwritten. An interrupt is generated if the ORE flag is set during multi buffer communication if the EIE bit is set. This bit is permanently forced to 0 (no overrun detection) when the bit OVRDIS is set in the USART_CR3 register..
Allowed values:
0x0: B_0x0: No overrun error
0x1: B_0x1: Overrun error is detected
Bit 4: Idle line detected This bit is set by hardware when an Idle Line is detected. An interrupt is generated if IDLEIEÂ =Â 1 in the USART_CR1 register. It is cleared by software, writing 1 to the IDLECF in the USART_ICR register. Note: The IDLE bit is not set again until the RXFNE bit has been set (i.e. a new idle line occurs). If Mute mode is enabled (MMEÂ =Â 1), IDLE is set if the USART is not mute (RWUÂ =Â 0), whatever the Mute mode selected by the WAKE bit. If RWUÂ =Â 1, IDLE is not set..
Allowed values:
0x0: B_0x0: No Idle line is detected
0x1: B_0x1: Idle line is detected
Bit 5: RXFIFO not empty RXFNE bit is set by hardware when the RXFIFO is not empty, meaning that data can be read from the USART_RDR register. Every read operation from the USART_RDR frees a location in the RXFIFO. RXFNE is cleared when the RXFIFO is empty. The RXFNE flag can also be cleared by writing 1 to the RXFRQ in the USART_RQR register. An interrupt is generated if RXFNEIEÂ =Â 1 in the USART_CR1 register..
Allowed values:
0x0: B_0x0: Data is not received
0x1: B_0x1: Received data is ready to be read.
Bit 6: Transmission complete This bit indicates that the last data written in the USART_TDR has been transmitted out of the shift register. It is set by hardware when the transmission of a frame containing data is complete and when TXFE is set. An interrupt is generated if TCIEÂ =Â 1 in the USART_CR1 register. TC bit is is cleared by software, by writing 1 to the TCCF in the USART_ICR register or by a write to the USART_TDR register. Note: If TE bit is reset and no transmission is on going, the TC bit is immediately set..
Allowed values:
0x0: B_0x0: Transmission is not complete
0x1: B_0x1: Transmission is complete
Bit 7: TXFIFO not full TXFNF is set by hardware when TXFIFO is not full meaning that data can be written in the USART_TDR. Every write operation to the USART_TDR places the data in the TXFIFO. This flag remains set until the TXFIFO is full. When the TXFIFO is full, this flag is cleared indicating that data can not be written into the USART_TDR. An interrupt is generated if the TXFNFIE bit =1 in the USART_CR1 register. Note: The TXFNF is kept reset during the flush request until TXFIFO is empty. After sending the flush request (by setting TXFRQ bit), the flag TXFNF should be checked prior to writing in TXFIFO (TXFNF and TXFE are set at the same time). This bit is used during single buffer transmission..
Allowed values:
0x0: B_0x0: Transmit FIFO is full
0x1: B_0x1: Transmit FIFO is not full
Bit 8: LIN break detection flag This bit is set by hardware when the LIN break is detected. It is cleared by software, by writing 1 to the LBDCF in the USART_ICR. An interrupt is generated if LBDIE = 1 in the USART_CR2 register. Note: If the USART does not support LIN mode, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: LIN Break not detected
0x1: B_0x1: LIN break detected
Bit 9: CTS interrupt flag This bit is set by hardware when the nCTS input toggles, if the CTSE bit is set. It is cleared by software, by writing 1 to the CTSCF bit in the USART_ICR register. An interrupt is generated if CTSIEÂ =Â 1 in the USART_CR3 register. Note: If the hardware flow control feature is not supported, this bit is reserved and kept at reset value..
Allowed values:
0x0: B_0x0: No change occurred on the nCTS status line
0x1: B_0x1: A change occurred on the nCTS status line
Bit 11: Receiver timeout This bit is set by hardware when the timeout value, programmed in the RTOR register has lapsed, without any communication. It is cleared by software, writing 1 to the RTOCF bit in the USART_ICR register. An interrupt is generated if RTOIEÂ =Â 1 in the USART_CR2 register. In Smartcard mode, the timeout corresponds to the CWT or BWT timings. Note: If a time equal to the value programmed in RTOR register separates 2 characters, RTOF is not set. If this time exceeds this value + 2 sample times (2/16 or 2/8, depending on the oversampling method), RTOF flag is set. The counter counts even if RE = 0 but RTOF is set only when RE = 1. If the timeout has already elapsed when RE is set, then RTOF is set. If the USART does not support the Receiver timeout feature, this bit is reserved and kept at reset value..
Allowed values:
0x0: B_0x0: Timeout value not reached
0x1: B_0x1: Timeout value reached without any data reception
Bit 12: End of block flag This bit is set by hardware when a complete block has been received (for example TÂ =Â 1 Smartcard mode). The detection is done when the number of received bytes (from the start of the block, including the prologue) is equal or greater than BLEN + 4. An interrupt is generated if the EOBIEÂ =Â 1 in the USART_CR2 register. It is cleared by software, writing 1 to the EOBCF in the USART_ICR register. Note: If Smartcard mode is not supported, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: End of Block not reached
0x1: B_0x1: End of Block (number of characters) reached
Bit 13: SPI slave underrun error flag In slave transmission mode, this flag is set when the first clock pulse for data transmission appears while the software has not yet loaded any value into USART_TDR. This flag is reset by setting UDRCF bit in the USART_ICR register. Note: If the USART does not support the SPI slave mode, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: No underrun error
0x1: B_0x1: underrun error
Bit 14: Auto baud rate error This bit is set by hardware if the baud rate measurement failed (baud rate out of range or character comparison failed) It is cleared by software, by writing 1 to the ABRRQ bit in the USART_CR3 register. Note: If the USART does not support the auto baud rate feature, this bit is reserved and kept at reset value..
Bit 15: Auto baud rate flag This bit is set by hardware when the automatic baud rate has been set (RXFNE is also set, generating an interrupt if RXFNEIE = 1) or when the auto baud rate operation was completed without success (ABREÂ =Â 1) (ABRE, RXFNE and FE are also set in this case) It is cleared by software, in order to request a new auto baud rate detection, by writing 1 to the ABRRQ in the USART_RQR register. Note: If the USART does not support the auto baud rate feature, this bit is reserved and kept at reset value..
Bit 16: Busy flag This bit is set and reset by hardware. It is active when a communication is ongoing on the RX line (successful start bit detected). It is reset at the end of the reception (successful or not)..
Allowed values:
0x0: B_0x0: USART is idle (no reception)
0x1: B_0x1: Reception on going
Bit 17: Character match flag This bit is set by hardware, when a the character defined by ADD[7:0] is received. It is cleared by software, writing 1 to the CMCF in the USART_ICR register. An interrupt is generated if CMIEÂ =Â 1in the USART_CR1 register..
Allowed values:
0x0: B_0x0: No Character match detected
0x1: B_0x1: Character Match detected
Bit 18: Send break flag This bit indicates that a send break character was requested. It is set by software, by writing 1 to the SBKRQ bit in the USART_CR3 register. It is automatically reset by hardware during the stop bit of break transmission..
Allowed values:
0x0: B_0x0: Break character transmitted
0x1: B_0x1: Break character requested by setting SBKRQ bit in USART_RQR register
Bit 19: Receiver wakeup from Mute mode This bit indicates if the USART is in Mute mode. It is cleared/set by hardware when a wakeup/mute sequence is recognized. The Mute mode control sequence (address or IDLE) is selected by the WAKE bit in the USART_CR1 register. When wakeup on IDLE mode is selected, this bit can only be set by software, writing 1 to the MMRQ bit in the USART_RQR register. Note: If the USART does not support the wakeup from Stop feature, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Receiver in active mode
0x1: B_0x1: Receiver in Mute mode
Bit 20: Wakeup from low-power mode flag This bit is set by hardware, when a wakeup event is detected. The event is defined by the WUS bitfield. It is cleared by software, writing a 1 to the WUCF in the USART_ICR register. An interrupt is generated if WUFIEÂ =Â 1 in the USART_CR3 register. Note: When UESM is cleared, WUF flag is also cleared. If the USART does not support the wakeup from Stop feature, this bit is reserved and kept at reset value. Refer to ..
Bit 21: Transmit enable acknowledge flag This bit is set/reset by hardware, when the Transmit Enable value is taken into account by the USART. It can be used when an idle frame request is generated by writing TEÂ =Â 0, followed by TEÂ =Â 1 in the USART_CR1 register, in order to respect the TEÂ =Â 0 minimum period..
Bit 22: Receive enable acknowledge flag This bit is set/reset by hardware, when the Receive Enable value is taken into account by the USART. It can be used to verify that the USART is ready for reception before entering low-power mode. Note: If the USART does not support the wakeup from Stop feature, this bit is reserved and kept at reset value. Refer to ..
Bit 23: TXFIFO empty This bit is set by hardware when TXFIFO is empty. When the TXFIFO contains at least one data, this flag is cleared. The TXFE flag can also be set by writing 1 to the bit TXFRQ (bit 4) in the USART_RQR register. An interrupt is generated if the TXFEIE bit  = 1 (bit 30) in the USART_CR1 register..
Allowed values:
0x0: B_0x0: TXFIFO not empty.
0x1: B_0x1: TXFIFO empty.
Bit 24: RXFIFO full This bit is set by hardware when the number of received data corresponds to RXFIFO size + 1 (RXFIFO full + 1 data in the USART_RDR register. An interrupt is generated if the RXFFIE bit  = 1 in the USART_CR1 register..
Allowed values:
0x0: B_0x0: RXFIFO not full.
0x1: B_0x1: RXFIFO Full.
Bit 25: Transmission complete before guard time flag This bit is set when the last data written in the USART_TDR has been transmitted correctly out of the shift register. It is set by hardware in Smartcard mode, if the transmission of a frame containing data is complete and if the smartcard did not send back any NACK. An interrupt is generated if TCBGTIE = 1 in the USART_CR3 register. This bit is cleared by software, by writing 1 to the TCBGTCF in the USART_ICR register or by a write to the USART_TDR register. Note: If the USART does not support the Smartcard mode, this bit is reserved and kept at reset value. If the USART supports the Smartcard mode and the Smartcard mode is enabled, the TCBGT reset value is '1â. Refer to on page 835..
Allowed values:
0x0: B_0x0: Transmission is not complete or transmission is complete unsuccessfully (i.e. a NACK is received from the card)
0x1: B_0x1: Transmission is complete successfully (before Guard time completion and there is no NACK from the smart card).
Bit 26: RXFIFO threshold flag This bit is set by hardware when the threshold programmed in RXFTCFG in USART_CR3 register is reached. This means that there are (RXFTCFG - 1) data in the Receive FIFO and one data in the USART_RDR register. An interrupt is generated if the RXFTIE bit  = 1 (bit 27) in the USART_CR3 register. Note: When the RXFTCFG threshold is configured to '101â, RXFT flag is set if 16 data are available i.e. 15 data in the RXFIFO and 1 data in the USART_RDR. Consequently, the 17th received data does not cause an overrun error. The overrun error occurs after receiving the 18th data..
Allowed values:
0x0: B_0x0: Receive FIFO does not reach the programmed threshold.
0x1: B_0x1: Receive FIFO reached the programmed threshold.
Bit 27: TXFIFO threshold flag This bit is set by hardware when the TXFIFO reaches the threshold programmed in TXFTCFG of USART_CR3 register i.e. the TXFIFO contains TXFTCFG empty locations. An interrupt is generated if the TXFTIE bit  = 1 (bit 31) in the USART_CR3 register..
Allowed values:
0x0: B_0x0: TXFIFO does not reach the programmed threshold.
0x1: B_0x1: TXFIFO reached the programmed threshold.
Receive data register
Offset: 0x24, reset: 0x0000, access: read-only
1/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
RDR
r |
|||||||||||||||
Transmit data register
Offset: 0x28, reset: 0x0000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
TDR
rw |
|||||||||||||||
Prescaler register
Offset: 0x2C, reset: 0x0000, access: read-write
1/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
PRESCALER
rw |
|||||||||||||||
Bits 0-3: Clock prescaler The USART input clock can be divided by a prescaler factor: Remaining combinations: Reserved Note: When PRESCALER is programmed with a value different of the allowed ones, programmed prescaler value is 1011 i.e. input clock divided by 256..
Allowed values:
0x0: B_0x0: input clock not divided
0x1: B_0x1: input clock divided by 2
0x2: B_0x2: input clock divided by 4
0x3: B_0x3: input clock divided by 6
0x4: B_0x4: input clock divided by 8
0x5: B_0x5: input clock divided by 10
0x6: B_0x6: input clock divided by 12
0x7: B_0x7: input clock divided by 16
0x8: B_0x8: input clock divided by 32
0x9: B_0x9: input clock divided by 64
0xA: B_0xA: input clock divided by 128
0xB: B_0xB: input clock divided by 256
0x40005000: Universal synchronous asynchronous receiver transmitter
136/170 fields covered. Toggle Registers
| Offset | Name | 31 |
30 |
29 |
28 |
27 |
26 |
25 |
24 |
23 |
22 |
21 |
20 |
19 |
18 |
17 |
16 |
15 |
14 |
13 |
12 |
11 |
10 |
9 |
8 |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x0 | CR1_FIFO_DISABLED | ||||||||||||||||||||||||||||||||
| 0x0 | CR1_FIFO_ENABLED | ||||||||||||||||||||||||||||||||
| 0x4 | CR2 | ||||||||||||||||||||||||||||||||
| 0x8 | CR3 | ||||||||||||||||||||||||||||||||
| 0xC | BRR | ||||||||||||||||||||||||||||||||
| 0x10 | GTPR | ||||||||||||||||||||||||||||||||
| 0x14 | RTOR | ||||||||||||||||||||||||||||||||
| 0x18 | RQR | ||||||||||||||||||||||||||||||||
| 0x1C | ISR_FIFO_DISABLED | ||||||||||||||||||||||||||||||||
| 0x1C | ISR_FIFO_ENABLED | ||||||||||||||||||||||||||||||||
| 0x20 | ICR | ||||||||||||||||||||||||||||||||
| 0x24 | RDR | ||||||||||||||||||||||||||||||||
| 0x28 | TDR | ||||||||||||||||||||||||||||||||
| 0x2C | PRESC | ||||||||||||||||||||||||||||||||
Control register 1
Offset: 0x0, reset: 0x0000, access: read-write
18/22 fields covered.
Bit 0: USART enable When this bit is cleared, the USART prescalers and outputs are stopped immediately, and all current operations are discarded. The USART configuration is kept, but all the USART_ISR status flags are reset. This bit is set and cleared by software. Note: To enter low-power mode without generating errors on the line, the TE bit must be previously reset and the software must wait for the TC bit in the USART_ISR to be set before resetting the UE bit. The DMA requests are also reset when UE = 0 so the DMA channel must be disabled before resetting the UE bit. In Smartcard mode, (SCEN = 1), the SCLK is always available when CLKEN = 1, regardless of the UE bit value..
Allowed values:
0x0: B_0x0: USART prescaler and outputs disabled, low-power mode
0x1: B_0x1: USART enabled
Bit 1: USART enable in low-power mode When this bit is cleared, the USART cannot wake up the MCU from low-power mode. When this bit is set, the USART can wake up the MCU from low-power mode. This bit is set and cleared by software. Note: It is recommended to set the UESM bit just before entering low-power mode and clear it when exit from low-power mode. If the USART does not support the wakeup from Stop feature, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: USART not able to wake up the MCU from low-power mode.
0x1: B_0x1: USART able to wake up the MCU from low-power mode.
Bit 3: Transmitter enable This bit enables the transmitter. It is set and cleared by software. Note: During transmission, a low pulse on the TE bit ('0â followed by '1â) sends a preamble (idle line) after the current word, except in Smartcard mode. In order to generate an idle character, the TE must not be immediately written to '1â. To ensure the required duration, the software can poll the TEACK bit in the USART_ISR register. In Smartcard mode, when TE is set, there is a 1 bit-time delay before the transmission starts..
Allowed values:
0x0: B_0x0: Transmitter is disabled
0x1: B_0x1: Transmitter is enabled
Bit 9: Parity selection This bit selects the odd or even parity when the parity generation/detection is enabled (PCE bit set). It is set and cleared by software. The parity is selected after the current byte. This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: Even parity
0x1: B_0x1: Odd parity
Bit 10: Parity control enable This bit selects the hardware parity control (generation and detection). When the parity control is enabled, the computed parity is inserted at the MSB position (9th bit if MÂ =Â 1; 8th bit if MÂ =Â 0) and the parity is checked on the received data. This bit is set and cleared by software. Once it is set, PCE is active after the current byte (in reception and in transmission). This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: Parity control disabled
0x1: B_0x1: Parity control enabled
Bit 13: Mute mode enable This bit enables the USART Mute mode function. When set, the USART can switch between active and Mute mode, as defined by the WAKE bit. It is set and cleared by software..
Allowed values:
0x0: B_0x0: Receiver in active mode permanently
0x1: B_0x1: Receiver can switch between Mute mode and active mode.
Bits 16-20: Driver Enable deassertion time This 5-bit value defines the time between the end of the last stop bit, in a transmitted message, and the de-activation of the DE (Driver Enable) signal. It is expressed in sample time units (1/8 or 1/16 bit time, depending on the oversampling rate). If the USART_TDR register is written during the DEDT time, the new data is transmitted only when the DEDT and DEAT times have both elapsed. This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If the Driver Enable feature is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Bits 21-25: Driver Enable assertion time This 5-bit value defines the time between the activation of the DE (Driver Enable) signal and the beginning of the start bit. It is expressed in sample time units (1/8 or 1/16 bit time, depending on the oversampling rate). This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If the Driver Enable feature is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Bit 26: Receiver timeout interrupt enable This bit is set and cleared by software. Note: If the USART does not support the Receiver timeout feature, this bit is reserved and must be kept at reset value. ..
Allowed values:
0x0: B_0x0: Interrupt inhibited
0x1: B_0x1: USART interrupt generated when the RTOF bit is set in the USART_ISR register.
Bit 27: End of Block interrupt enable This bit is set and cleared by software. Note: If the USART does not support Smartcard mode, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Interrupt inhibited
0x1: B_0x1: USART interrupt generated when the EOBF flag is set in the USART_ISR register
Bit 28: Word length This bit must be used in conjunction with bit 12 (M0) to determine the word length. It is set or cleared by software. M[1:0] = '00â: 1 start bit, 8 Data bits, n Stop bit M[1:0] = '01â: 1 start bit, 9 Data bits, n Stop bit M[1:0] = '10â: 1 start bit, 7 Data bits, n Stop bit This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: In 7-bits data length mode, the Smartcard mode, LIN master mode and Auto baud rate (0x7F and 0x55 frames detection) are not supported..
Bit 29: FIFO mode enable This bit is set and cleared by software. This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: FIFO mode can be used on standard UART communication, in SPI master/slave mode and in Smartcard modes only. It must not be enabled in IrDA and LIN modes..
Allowed values:
0x0: B_0x0: FIFO mode is disabled.
0x1: B_0x1: FIFO mode is enabled.
Control register 1
Offset: 0x0, reset: 0x0000, access: read-write
20/24 fields covered.
Bit 0: USART enable When this bit is cleared, the USART prescalers and outputs are stopped immediately, and all current operations are discarded. The USART configuration is kept, but all the USART_ISR status flags are reset. This bit is set and cleared by software. Note: To enter low-power mode without generating errors on the line, the TE bit must be previously reset and the software must wait for the TC bit in the USART_ISR to be set before resetting the UE bit. The DMA requests are also reset when UE = 0 so the DMA channel must be disabled before resetting the UE bit. In Smartcard mode, (SCEN = 1), the SCLK is always available when CLKEN = 1, regardless of the UE bit value..
Allowed values:
0x0: B_0x0: USART prescaler and outputs disabled, low-power mode
0x1: B_0x1: USART enabled
Bit 1: USART enable in low-power mode When this bit is cleared, the USART cannot wake up the MCU from low-power mode. When this bit is set, the USART can wake up the MCU from low-power mode. This bit is set and cleared by software. Note: It is recommended to set the UESM bit just before entering low-power mode and clear it when exit from low-power mode. If the USART does not support the wakeup from Stop feature, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: USART not able to wake up the MCU from low-power mode.
0x1: B_0x1: USART able to wake up the MCU from low-power mode.
Bit 3: Transmitter enable This bit enables the transmitter. It is set and cleared by software. Note: During transmission, a low pulse on the TE bit ('0â followed by '1â) sends a preamble (idle line) after the current word, except in Smartcard mode. In order to generate an idle character, the TE must not be immediately written to '1â. To ensure the required duration, the software can poll the TEACK bit in the USART_ISR register. In Smartcard mode, when TE is set, there is a 1 bit-time delay before the transmission starts..
Allowed values:
0x0: B_0x0: Transmitter is disabled
0x1: B_0x1: Transmitter is enabled
Bit 9: Parity selection This bit selects the odd or even parity when the parity generation/detection is enabled (PCE bit set). It is set and cleared by software. The parity is selected after the current byte. This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: Even parity
0x1: B_0x1: Odd parity
Bit 10: Parity control enable This bit selects the hardware parity control (generation and detection). When the parity control is enabled, the computed parity is inserted at the MSB position (9th bit if MÂ =Â 1; 8th bit if MÂ =Â 0) and the parity is checked on the received data. This bit is set and cleared by software. Once it is set, PCE is active after the current byte (in reception and in transmission). This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: Parity control disabled
0x1: B_0x1: Parity control enabled
Bit 13: Mute mode enable This bit enables the USART Mute mode function. When set, the USART can switch between active and Mute mode, as defined by the WAKE bit. It is set and cleared by software..
Allowed values:
0x0: B_0x0: Receiver in active mode permanently
0x1: B_0x1: Receiver can switch between Mute mode and active mode.
Bits 16-20: Driver Enable deassertion time This 5-bit value defines the time between the end of the last stop bit, in a transmitted message, and the de-activation of the DE (Driver Enable) signal. It is expressed in sample time units (1/8 or 1/16 bit time, depending on the oversampling rate). If the USART_TDR register is written during the DEDT time, the new data is transmitted only when the DEDT and DEAT times have both elapsed. This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If the Driver Enable feature is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Bits 21-25: Driver Enable assertion time This 5-bit value defines the time between the activation of the DE (Driver Enable) signal and the beginning of the start bit. It is expressed in sample time units (1/8 or 1/16 bit time, depending on the oversampling rate). This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If the Driver Enable feature is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Bit 26: Receiver timeout interrupt enable This bit is set and cleared by software. Note: If the USART does not support the Receiver timeout feature, this bit is reserved and must be kept at reset value. ..
Allowed values:
0x0: B_0x0: Interrupt inhibited
0x1: B_0x1: USART interrupt generated when the RTOF bit is set in the USART_ISR register.
Bit 27: End of Block interrupt enable This bit is set and cleared by software. Note: If the USART does not support Smartcard mode, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Interrupt inhibited
0x1: B_0x1: USART interrupt generated when the EOBF flag is set in the USART_ISR register
Bit 28: Word length This bit must be used in conjunction with bit 12 (M0) to determine the word length. It is set or cleared by software. M[1:0] = '00â: 1 start bit, 8 Data bits, n Stop bit M[1:0] = '01â: 1 start bit, 9 Data bits, n Stop bit M[1:0] = '10â: 1 start bit, 7 Data bits, n Stop bit This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: In 7-bits data length mode, the Smartcard mode, LIN master mode and Auto baud rate (0x7F and 0x55 frames detection) are not supported..
Bit 29: FIFO mode enable This bit is set and cleared by software. This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: FIFO mode can be used on standard UART communication, in SPI master/slave mode and in Smartcard modes only. It must not be enabled in IrDA and LIN modes..
Allowed values:
0x0: B_0x0: FIFO mode is disabled.
0x1: B_0x1: FIFO mode is enabled.
Control register 2
Offset: 0x4, reset: 0x0000, access: read-write
19/20 fields covered.
Bit 3: When the DIS_NSS bit is set, the NSS pin input is ignored. Note: When SPI slave mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: SPI slave selection depends on NSS input pin.
0x1: B_0x1: SPI slave is always selected and NSS input pin is ignored.
Bit 4: 7-bit Address Detection/4-bit Address Detection This bit is for selection between 4-bit address detection or 7-bit address detection. This bit can only be written when the USART is disabled (UEÂ =Â 0) Note: In 7-bit and 9-bit data modes, the address detection is done on 6-bit and 8-bit address (ADD[5:0] and ADD[7:0]) respectively..
Allowed values:
0x0: B_0x0: 4-bit address detection
0x1: B_0x1: 7-bit address detection (in 8-bit data mode)
Bit 5: LIN break detection length This bit is for selection between 11 bit or 10 bit break detection. This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If LIN mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: 10-bit break detection
0x1: B_0x1: 11-bit break detection
Bit 6: LIN break detection interrupt enable Break interrupt mask (break detection using break delimiter). Note: If LIN mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Interrupt is inhibited
0x1: B_0x1: An interrupt is generated whenever LBDF = 1 in the USART_ISR register
Bit 8: Last bit clock pulse This bit is used to select whether the clock pulse associated with the last data bit transmitted (MSB) has to be output on the SCLK pin in synchronous mode. The last bit is the 7th or 8th or 9th data bit transmitted depending on the 7 or 8 or 9 bit format selected by the M bit in the USART_CR1 register. This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If synchronous mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: The clock pulse of the last data bit is not output to the SCLK pin
0x1: B_0x1: The clock pulse of the last data bit is output to the SCLK pin
Bit 9: Clock phase This bit is used to select the phase of the clock output on the SCLK pin in synchronous mode. It works in conjunction with the CPOL bit to produce the desired clock/data relationship (see and ) This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If synchronous mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: The first clock transition is the first data capture edge
0x1: B_0x1: The second clock transition is the first data capture edge
Bit 10: Clock polarity This bit enables the user to select the polarity of the clock output on the SCLK pin in synchronous mode. It works in conjunction with the CPHA bit to produce the desired clock/data relationship This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If synchronous mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Steady low value on SCLK pin outside transmission window
0x1: B_0x1: Steady high value on SCLK pin outside transmission window
Bit 11: Clock enable This bit enables the user to enable the SCLK pin. This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If neither synchronous mode nor Smartcard mode is supported, this bit is reserved and must be kept at reset value. Refer to . In Smartcard mode, in order to provide correctly the SCLK clock to the smartcard, the steps below must be respected: UE = 0 SCEN = 1 GTPR configuration CLKEN= 1 UE = 1.
Allowed values:
0x0: B_0x0: SCLK pin disabled
0x1: B_0x1: SCLK pin enabled
Bit 14: LIN mode enable This bit is set and cleared by software. The LIN mode enables the capability to send LIN synchronous breaks (13 low bits) using the SBKRQ bit in the USART_CR1 register, and to detect LIN Sync breaks. This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If the USART does not support LIN mode, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: LIN mode disabled
0x1: B_0x1: LIN mode enabled
Bit 15: Swap TX/RX pins This bit is set and cleared by software. This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: TX/RX pins are used as defined in standard pinout
0x1: B_0x1: The TX and RX pins functions are swapped. This enables to work in the case of a cross-wired connection to another UART.
Bit 16: RX pin active level inversion This bit is set and cleared by software. This enables the use of an external inverter on the RX line. This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: RX pin signal works using the standard logic levels (VDD =1/idle, Gnd = 0/mark)
0x1: B_0x1: RX pin signal values are inverted (VDD =0/mark, Gnd = 1/idle).
Bit 17: TX pin active level inversion This bit is set and cleared by software. This enables the use of an external inverter on the TX line. This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: TX pin signal works using the standard logic levels (VDD =1/idle, Gnd = 0/mark)
0x1: B_0x1: TX pin signal values are inverted (VDD =0/mark, Gnd = 1/idle).
Bit 18: Binary data inversion This bit is set and cleared by software. This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: Logical data from the data register are send/received in positive/direct logic. (1 = H, 0 = L)
0x1: B_0x1: Logical data from the data register are send/received in negative/inverse logic. (1 = L, 0 = H). The parity bit is also inverted.
Bit 19: Most significant bit first This bit is set and cleared by software. This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: data is transmitted/received with data bit 0 first, following the start bit.
0x1: B_0x1: data is transmitted/received with the MSB (bit 7/8) first, following the start bit.
Bit 20: Auto baud rate enable This bit is set and cleared by software. Note: If the USART does not support the auto baud rate feature, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Auto baud rate detection is disabled.
0x1: B_0x1: Auto baud rate detection is enabled.
Bits 21-22: Auto baud rate mode These bits are set and cleared by software. This bitfield can only be written when ABREN = 0 or the USART is disabled (UEÂ =Â 0). Note: If DATAINVÂ =Â 1 and/or MSBFIRSTÂ =Â 1 the patterns must be the same on the line, for example 0xAA for MSBFIRST) If the USART does not support the auto baud rate feature, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Measurement of the start bit is used to detect the baud rate.
0x1: B_0x1: Falling edge to falling edge measurement (the received frame must start with a single bit = 1 and Frame = Start10xxxxxx)
0x2: B_0x2: 0x7F frame detection.
0x3: B_0x3: 0x55 frame detection
Bit 23: Receiver timeout enable This bit is set and cleared by software. When this feature is enabled, the RTOF flag in the USART_ISR register is set if the RX line is idle (no reception) for the duration programmed in the RTOR (receiver timeout register). Note: If the USART does not support the Receiver timeout feature, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Receiver timeout feature disabled.
0x1: B_0x1: Receiver timeout feature enabled.
Bits 24-31: Address of the USART node ADD[7:4]: These bits give the address of the USART node or a character code to be recognized. They are used to wake up the MCU with 7-bit address mark detection in multiprocessor communication during Mute mode or low-power mode. The MSB of the character sent by the transmitter should be equal to 1. They can also be used for character detection during normal reception, Mute mode inactive (for example, end of block detection in ModBus protocol). In this case, the whole received character (8-bit) is compared to the ADD[7:0] value and CMF flag is set on match. These bits can only be written when reception is disabled (RE = 0) or the USART is disabled (UEÂ =Â 0). ADD[3:0]: These bits give the address of the USART node or a character code to be recognized. They are used for wakeup with address mark detection, in multiprocessor communication during Mute mode or low-power mode. These bits can only be written when reception is disabled (RE = 0) or the USART is disabled (UEÂ =Â 0)..
Control register 3
Offset: 0x8, reset: 0x0000, access: read-write
24/24 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
TXFTCFG
rw |
RXFTIE
rw |
RXFTCFG
rw |
TCBGTIE
rw |
TXFTIE
rw |
WUFIE
rw |
WUS
rw |
SCARCNT
rw |
||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
DEP
rw |
DEM
rw |
DDRE
rw |
OVRDIS
rw |
ONEBIT
rw |
CTSIE
rw |
CTSE
rw |
RTSE
rw |
DMAT
rw |
DMAR
rw |
SCEN
rw |
NACK
rw |
HDSEL
rw |
IRLP
rw |
IREN
rw |
EIE
rw |
Bit 0: Error interrupt enable Error Interrupt Enable Bit is required to enable interrupt generation in case of a framing error, overrun error noise flag or SPI slave underrun error (FEÂ =Â 1 or OREÂ =Â 1 or NEÂ =Â 1 or UDR = 1 in the USART_ISR register)..
Allowed values:
0x0: B_0x0: Interrupt inhibited
0x1: B_0x1: interrupt generated when FE = 1 or ORE = 1 or NE = 1 or UDR = 1 (in SPI slave mode) in the USART_ISR register.
Bit 1: IrDA mode enable This bit is set and cleared by software. This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If IrDA mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: IrDA disabled
0x1: B_0x1: IrDA enabled
Bit 2: IrDA low-power This bit is used for selecting between normal and low-power IrDA modes This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If IrDA mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Normal mode
0x1: B_0x1: Low-power mode
Bit 4: Smartcard NACK enable This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If the USART does not support Smartcard mode, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: NACK transmission in case of parity error is disabled
0x1: B_0x1: NACK transmission during parity error is enabled
Bit 5: Smartcard mode enable This bit is used for enabling Smartcard mode. This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If the USART does not support Smartcard mode, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Smartcard Mode disabled
0x1: B_0x1: Smartcard Mode enabled
Bit 8: RTS enable This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If the hardware flow control feature is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: RTS hardware flow control disabled
0x1: B_0x1: RTS output enabled, data is only requested when there is space in the receive buffer. The transmission of data is expected to cease after the current character has been transmitted. The nRTS output is asserted (pulled to 0) when data can be received.
Bit 9: CTS enable This bit can only be written when the USART is disabled (UEÂ =Â 0) Note: If the hardware flow control feature is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: CTS hardware flow control disabled
0x1: B_0x1: CTS mode enabled, data is only transmitted when the nCTS input is asserted (tied to 0). If the nCTS input is deasserted while data is being transmitted, then the transmission is completed before stopping. If data is written into the data register while nCTS is asserted, the transmission is postponed until nCTS is asserted.
Bit 11: One sample bit method enable This bit enables the user to select the sample method. When the one sample bit method is selected the noise detection flag (NE) is disabled. This bit can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: Three sample bit method
0x1: B_0x1: One sample bit method
Bit 12: Overrun Disable This bit is used to disable the receive overrun detection. the ORE flag is not set and the new received data overwrites the previous content of the USART_RDR register. When FIFO mode is enabled, the RXFIFO is bypassed and data is written directly in USART_RDR register. Even when FIFO management is enabled, the RXNE flag is to be used. This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: This control bit enables checking the communication flow w/o reading the data.
Allowed values:
0x0: B_0x0: Overrun Error Flag, ORE, is set when received data is not read before receiving new data.
0x1: B_0x1: Overrun functionality is disabled. If new data is received while the RXNE flag is still set
Bit 13: DMA Disable on Reception Error This bit can only be written when the USART is disabled (UE=0). Note: The reception errors are: parity error, framing error or noise error..
Allowed values:
0x0: B_0x0: DMA is not disabled in case of reception error. The corresponding error flag is set but RXNE is kept 0 preventing from overrun. As a consequence, the DMA request is not asserted, so the erroneous data is not transferred (no DMA request), but next correct received data is transferred (used for Smartcard mode).
0x1: B_0x1: DMA is disabled following a reception error. The corresponding error flag is set, as well as RXNE. The DMA request is masked until the error flag is cleared. This means that the software must first disable the DMA request (DMAR = 0) or clear RXNE/RXFNE is case FIFO mode is enabled) before clearing the error flag.
Bit 14: Driver enable mode This bit enables the user to activate the external transceiver control, through the DE signal. This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If the Driver Enable feature is not supported, this bit is reserved and must be kept at reset value. ..
Allowed values:
0x0: B_0x0: DE function is disabled.
0x1: B_0x1: DE function is enabled. The DE signal is output on the RTS pin.
Bit 15: Driver enable polarity selection This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If the Driver Enable feature is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: DE signal is active high.
0x1: B_0x1: DE signal is active low.
Bits 17-19: Smartcard auto-retry count This bitfield specifies the number of retries for transmission and reception in Smartcard mode. In transmission mode, it specifies the number of automatic retransmission retries, before generating a transmission error (FE bit set). In reception mode, it specifies the number or erroneous reception trials, before generating a reception error (RXNE/RXFNE and PE bits set). This bitfield must be programmed only when the USART is disabled (UEÂ =Â 0). When the USART is enabled (UEÂ =Â 1), this bitfield may only be written to 0x0, in order to stop retransmission. Note: If Smartcard mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: retransmission disabled - No automatic retransmission in transmit mode.
0x1: B_0x1: number of automatic retransmission attempts (before signaling error)
0x2: B_0x2: number of automatic retransmission attempts (before signaling error)
0x3: B_0x3: number of automatic retransmission attempts (before signaling error)
0x4: B_0x4: number of automatic retransmission attempts (before signaling error)
0x5: B_0x5: number of automatic retransmission attempts (before signaling error)
0x6: B_0x6: number of automatic retransmission attempts (before signaling error)
0x7: B_0x7: number of automatic retransmission attempts (before signaling error)
Bits 20-21: Wakeup from low-power mode interrupt flag selection This bitfield specifies the event which activates the WUF (Wakeup from low-power mode flag). This bitfield can only be written when the USART is disabled (UE = 0). If the USART does not support the wakeup from Stop feature, this bit is reserved and must be kept at reset value. Refer to page 835..
Allowed values:
0x0: B_0x0: WUF active on address match (as defined by ADD[7:0] and ADDM7)
0x2: B_0x2: WUF active on start bit detection
0x3: B_0x3: WUF active on RXNE/RXFNE.
Bit 22: Wakeup from low-power mode interrupt enable This bit is set and cleared by software. Note: WUFIE must be set before entering in low-power mode. If the USART does not support the wakeup from Stop feature, this bit is reserved and must be kept at reset value. Refer to page 835..
Allowed values:
0x0: B_0x0: Interrupt inhibited
0x1: B_0x1: USART interrupt generated whenever WUF = 1 in the USART_ISR register
Bit 24: Transmission Complete before guard time, interrupt enable This bit is set and cleared by software. Note: If the USART does not support the Smartcard mode, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Interrupt inhibited
0x1: B_0x1: USART interrupt generated whenever TCBGT=1 in the USART_ISR register
Bits 25-27: Receive FIFO threshold configuration Remaining combinations: Reserved.
Allowed values:
0x0: B_0x0: Receive FIFO reaches 1/8 of its depth
0x1: B_0x1: Receive FIFO reaches 1/4 of its depth
0x2: B_0x2: Receive FIFO reaches 1/2 of its depth
0x3: B_0x3: Receive FIFO reaches 3/4 of its depth
0x4: B_0x4: Receive FIFO reaches 7/8 of its depth
0x5: B_0x5: Receive FIFO becomes full
Bits 29-31: TXFIFO threshold configuration Remaining combinations: Reserved.
Allowed values:
0x0: B_0x0: TXFIFO reaches 1/8 of its depth
0x1: B_0x1: TXFIFO reaches 1/4 of its depth
0x2: B_0x2: TXFIFO reaches 1/2 of its depth
0x3: B_0x3: TXFIFO reaches 3/4 of its depth
0x4: B_0x4: TXFIFO reaches 7/8 of its depth
0x5: B_0x5: TXFIFO becomes empty
Baud rate register
Offset: 0xC, reset: 0x0000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
BRR
rw |
|||||||||||||||
Guard time and prescaler register
Offset: 0x10, reset: 0x0000, access: read-write
1/2 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
GT
rw |
PSC
rw |
||||||||||||||
Bits 0-7: Prescaler value In IrDA low-power and normal IrDA mode: PSC[7:0] = IrDA Normal and Low-Power baud rate PSC[7:0] is used to program the prescaler for dividing the USART source clock to achieve the low-power frequency: the source clock is divided by the value given in the register (8 significant bits): In Smartcard mode: PSC[4:0]Â =Â Prescaler value PSC[4:0] is used to program the prescaler for dividing the USART source clock to provide the Smartcard clock. The value given in the register (5 significant bits) is multiplied by 2 to give the division factor of the source clock frequency: ... 0010Â 0000: Divides the source clock by 32 (IrDA mode) ... 1111Â 1111: Divides the source clock by 255 (IrDA mode) This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: Bits [7:5] must be kept cleared if Smartcard mode is used. This bitfield is reserved and forced by hardware to '0â when the Smartcard and IrDA modes are not supported. Refer to ..
Allowed values:
0x0: B_0x0: Reserved - do not program this value
0x1: B_0x1: Divides the source clock by 1 (IrDA mode) / by 2 (Smarcard mode)
0x2: B_0x2: Divides the source clock by 2 (IrDA mode) / by 4 (Smartcard mode)
0x3: B_0x3: Divides the source clock by 3 (IrDA mode) / by 6 (Smartcard mode)
0x1F: B_0x1F: Divides the source clock by 31 (IrDA mode) / by 62 (Smartcard mode)
Bits 8-15: Guard time value This bitfield is used to program the Guard time value in terms of number of baud clock periods. This is used in Smartcard mode. The Transmission Complete flag is set after this guard time value. This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If Smartcard mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Receiver timeout register
Offset: 0x14, reset: 0x0000, access: read-write
0/2 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
BLEN
rw |
RTO
rw |
||||||||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
RTO
rw |
|||||||||||||||
Request register
Offset: 0x18, reset: 0x0000, access: write-only
0/5 fields covered.
Bit 0: Auto baud rate request Writing 1 to this bit resets the ABRF flag in the USART_ISR and requests an automatic baud rate measurement on the next received data frame. Note: If the USART does not support the auto baud rate feature, this bit is reserved and must be kept at reset value. Refer to ..
Bit 1: Send break request Writing 1 to this bit sets the SBKF flag and request to send a BREAK on the line, as soon as the transmit machine is available. Note: When the application needs to send the break character following all previously inserted data, including the ones not yet transmitted, the software should wait for the TXE flag assertion before setting the SBKRQ bit..
Bit 4: Transmit data flush request When FIFO mode is disabled, writing '1â to this bit sets the TXE flag. This enables to discard the transmit data. This bit must be used only in Smartcard mode, when data have not been sent due to errors (NACK) and the FE flag is active in the USART_ISR register. If the USART does not support Smartcard mode, this bit is reserved and must be kept at reset value. When FIFO is enabled, TXFRQ bit is set to flush the whole FIFO. This sets the TXFE flag (Transmit FIFO empty, bit 23 in the USART_ISR register). Flushing the Transmit FIFO is supported in both UART and Smartcard modes. Note: In FIFO mode, the TXFNF flag is reset during the flush request until TxFIFO is empty in order to ensure that no data are written in the data register..
Interrupt & status register
Offset: 0x1C, reset: 0x000000C0, access: read-only
24/24 fields covered.
Bit 0: Parity error This bit is set by hardware when a parity error occurs in receiver mode. It is cleared by software, writing 1 to the PECF in the USART_ICR register. An interrupt is generated if PEIE = 1 in the USART_CR1 register..
Allowed values:
0x0: B_0x0: No parity error
0x1: B_0x1: Parity error
Bit 1: Framing error This bit is set by hardware when a de-synchronization, excessive noise or a break character is detected. It is cleared by software, writing 1 to the FECF bit in the USART_ICR register. When transmitting data in Smartcard mode, this bit is set when the maximum number of transmit attempts is reached without success (the card NACKs the data frame). An interrupt is generated if EIEÂ =Â 1 in the USART_CR1 register..
Allowed values:
0x0: B_0x0: No Framing error is detected
0x1: B_0x1: Framing error or break character is detected
Bit 2: Noise detection flag This bit is set by hardware when noise is detected on a received frame. It is cleared by software, writing 1 to the NECF bit in the USART_ICR register. Note: This bit does not generate an interrupt as it appears at the same time as the RXNE bit which itself generates an interrupt. An interrupt is generated when the NE flag is set during multi buffer communication if the EIE bit is set. When the line is noise-free, the NE flag can be disabled by programming the ONEBIT bit to 1 to increase the USART tolerance to deviations (Refer to Tolerance of the USART receiver to clock deviation on page 861)..
Allowed values:
0x0: B_0x0: No noise is detected
0x1: B_0x1: Noise is detected
Bit 3: Overrun error This bit is set by hardware when the data currently being received in the shift register is ready to be transferred into the USART_RDR register while RXNEÂ =Â 1. It is cleared by a software, writing 1 to the ORECF, in the USART_ICR register. An interrupt is generated if RXNEIEÂ =Â 1 or EIE Â =Â 1 in the USART_CR1 register. Note: When this bit is set, the USART_RDR register content is not lost but the shift register is overwritten. An interrupt is generated if the ORE flag is set during multi buffer communication if the EIE bit is set. This bit is permanently forced to 0 (no overrun detection) when the bit OVRDIS is set in the USART_CR3 register..
Allowed values:
0x0: B_0x0: No overrun error
0x1: B_0x1: Overrun error is detected
Bit 4: Idle line detected This bit is set by hardware when an Idle Line is detected. An interrupt is generated if IDLEIEÂ =Â 1 in the USART_CR1 register. It is cleared by software, writing 1 to the IDLECF in the USART_ICR register. Note: The IDLE bit is not set again until the RXNE bit has been set (i.e. a new idle line occurs). If Mute mode is enabled (MMEÂ =Â 1), IDLE is set if the USART is not mute (RWUÂ =Â 0), whatever the Mute mode selected by the WAKE bit. If RWUÂ =Â 1, IDLE is not set..
Allowed values:
0x0: B_0x0: No Idle line is detected
0x1: B_0x1: Idle line is detected
Bit 5: Read data register not empty RXNE bit is set by hardware when the content of the USART_RDR shift register has been transferred to the USART_RDR register. It is cleared by reading from the USART_RDR register. The RXNE flag can also be cleared by writing 1 to the RXFRQ in the USART_RQR register. An interrupt is generated if RXNEIEÂ =Â 1 in the USART_CR1 register..
Allowed values:
0x0: B_0x0: Data is not received
0x1: B_0x1: Received data is ready to be read.
Bit 6: Transmission complete This bit indicates that the last data written in the USART_TDR has been transmitted out of the shift register. It is set by hardware when the transmission of a frame containing data is complete and when TXE is set. An interrupt is generated if TCIEÂ =Â 1 in the USART_CR1 register. TC bit is is cleared by software, by writing 1 to the TCCF in the USART_ICR register or by a write to the USART_TDR register. Note: If TE bit is reset and no transmission is on going, the TC bit is set immediately..
Allowed values:
0x0: B_0x0: Transmission is not complete
0x1: B_0x1: Transmission is complete
Bit 7: Transmit data register empty TXE is set by hardware when the content of the USART_TDR register has been transferred into the shift register. It is cleared by writing to the USART_TDR register. The TXE flag can also be set by writing 1 to the TXFRQ in the USART_RQR register, in order to discard the data (only in Smartcard T = 0 mode, in case of transmission failure). An interrupt is generated if the TXEIE bit  = 1 in the USART_CR1 register..
Allowed values:
0x0: B_0x0: Data register full
0x1: B_0x1: Data register not full
Bit 8: LIN break detection flag This bit is set by hardware when the LIN break is detected. It is cleared by software, by writing 1 to the LBDCF in the USART_ICR. An interrupt is generated if LBDIE = 1 in the USART_CR2 register. Note: If the USART does not support LIN mode, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: LIN Break not detected
0x1: B_0x1: LIN break detected
Bit 9: CTS interrupt flag This bit is set by hardware when the nCTS input toggles, if the CTSE bit is set. It is cleared by software, by writing 1 to the CTSCF bit in the USART_ICR register. An interrupt is generated if CTSIEÂ =Â 1 in the USART_CR3 register. Note: If the hardware flow control feature is not supported, this bit is reserved and kept at reset value..
Allowed values:
0x0: B_0x0: No change occurred on the nCTS status line
0x1: B_0x1: A change occurred on the nCTS status line
Bit 11: Receiver timeout This bit is set by hardware when the timeout value, programmed in the RTOR register has lapsed, without any communication. It is cleared by software, writing 1 to the RTOCF bit in the USART_ICR register. An interrupt is generated if RTOIEÂ =Â 1 in the USART_CR2 register. In Smartcard mode, the timeout corresponds to the CWT or BWT timings. Note: If a time equal to the value programmed in RTOR register separates 2 characters, RTOF is not set. If this time exceeds this value + 2 sample times (2/16 or 2/8, depending on the oversampling method), RTOF flag is set. The counter counts even if RE = 0 but RTOF is set only when RE = 1. If the timeout has already elapsed when RE is set, then RTOF is set. If the USART does not support the Receiver timeout feature, this bit is reserved and kept at reset value..
Allowed values:
0x0: B_0x0: Timeout value not reached
0x1: B_0x1: Timeout value reached without any data reception
Bit 12: End of block flag This bit is set by hardware when a complete block has been received (for example TÂ =Â 1 Smartcard mode). The detection is done when the number of received bytes (from the start of the block, including the prologue) is equal or greater than BLEN + 4. An interrupt is generated if the EOBIEÂ =Â 1 in the USART_CR2 register. It is cleared by software, writing 1 to the EOBCF in the USART_ICR register. Note: If Smartcard mode is not supported, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: End of Block not reached
0x1: B_0x1: End of Block (number of characters) reached
Bit 13: SPI slave underrun error flag In slave transmission mode, this flag is set when the first clock pulse for data transmission appears while the software has not yet loaded any value into USART_TDR. This flag is reset by setting UDRCF bit in the USART_ICR register. Note: If the USART does not support the SPI slave mode, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: No underrun error
0x1: B_0x1: underrun error
Bit 14: Auto baud rate error This bit is set by hardware if the baud rate measurement failed (baud rate out of range or character comparison failed) It is cleared by software, by writing 1 to the ABRRQ bit in the USART_CR3 register. Note: If the USART does not support the auto baud rate feature, this bit is reserved and kept at reset value..
Bit 15: Auto baud rate flag This bit is set by hardware when the automatic baud rate has been set (RXNE is also set, generating an interrupt if RXNEIE = 1) or when the auto baud rate operation was completed without success (ABREÂ =Â 1) (ABRE, RXNE and FE are also set in this case) It is cleared by software, in order to request a new auto baud rate detection, by writing 1 to the ABRRQ in the USART_RQR register. Note: If the USART does not support the auto baud rate feature, this bit is reserved and kept at reset value..
Bit 16: Busy flag This bit is set and reset by hardware. It is active when a communication is ongoing on the RX line (successful start bit detected). It is reset at the end of the reception (successful or not)..
Allowed values:
0x0: B_0x0: USART is idle (no reception)
0x1: B_0x1: Reception on going
Bit 17: Character match flag This bit is set by hardware, when a the character defined by ADD[7:0] is received. It is cleared by software, writing 1 to the CMCF in the USART_ICR register. An interrupt is generated if CMIEÂ =Â 1in the USART_CR1 register..
Allowed values:
0x0: B_0x0: No Character match detected
0x1: B_0x1: Character Match detected
Bit 18: Send break flag This bit indicates that a send break character was requested. It is set by software, by writing 1 to the SBKRQ bit in the USART_CR3 register. It is automatically reset by hardware during the stop bit of break transmission..
Allowed values:
0x0: B_0x0: Break character transmitted
0x1: B_0x1: Break character requested by setting SBKRQ bit in USART_RQR register
Bit 19: Receiver wakeup from Mute mode This bit indicates if the USART is in Mute mode. It is cleared/set by hardware when a wakeup/mute sequence is recognized. The Mute mode control sequence (address or IDLE) is selected by the WAKE bit in the USART_CR1 register. When wakeup on IDLE mode is selected, this bit can only be set by software, writing 1 to the MMRQ bit in the USART_RQR register. Note: If the USART does not support the wakeup from Stop feature, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Receiver in active mode
0x1: B_0x1: Receiver in Mute mode
Bit 20: Wakeup from low-power mode flag This bit is set by hardware, when a wakeup event is detected. The event is defined by the WUS bitfield. It is cleared by software, writing a 1 to the WUCF in the USART_ICR register. An interrupt is generated if WUFIEÂ =Â 1 in the USART_CR3 register. Note: When UESM is cleared, WUF flag is also cleared. If the USART does not support the wakeup from Stop feature, this bit is reserved and kept at reset value. Refer to ..
Bit 21: Transmit enable acknowledge flag This bit is set/reset by hardware, when the Transmit Enable value is taken into account by the USART. It can be used when an idle frame request is generated by writing TEÂ =Â 0, followed by TEÂ =Â 1 in the USART_CR1 register, in order to respect the TEÂ =Â 0 minimum period..
Bit 22: Receive enable acknowledge flag This bit is set/reset by hardware, when the Receive Enable value is taken into account by the USART. It can be used to verify that the USART is ready for reception before entering low-power mode. Note: If the USART does not support the wakeup from Stop feature, this bit is reserved and kept at reset value. Refer to ..
Bit 25: Transmission complete before guard time flag This bit is set when the last data written in the USART_TDR has been transmitted correctly out of the shift register. It is set by hardware in Smartcard mode, if the transmission of a frame containing data is complete and if the smartcard did not send back any NACK. An interrupt is generated if TCBGTIE = 1 in the USART_CR3 register. This bit is cleared by software, by writing 1 to the TCBGTCF in the USART_ICR register or by a write to the USART_TDR register. Note: If the USART does not support the Smartcard mode, this bit is reserved and kept at reset value. If the USART supports the Smartcard mode and the Smartcard mode is enabled, the TCBGT reset value is '1â. Refer to on page 835..
Allowed values:
0x0: B_0x0: Transmission is not complete or transmission is complete unsuccessfully (i.e. a NACK is received from the card)
0x1: B_0x1: Transmission is complete successfully (before Guard time completion and there is no NACK from the smart card).
Interrupt & status register
Offset: 0x1C, reset: 0x008000C0, access: read-only
28/28 fields covered.
Bit 0: Parity error This bit is set by hardware when a parity error occurs in receiver mode. It is cleared by software, writing 1 to the PECF in the USART_ICR register. An interrupt is generated if PEIE = 1 in the USART_CR1 register. Note: This error is associated with the character in the USART_RDR..
Allowed values:
0x0: B_0x0: No parity error
0x1: B_0x1: Parity error
Bit 1: Framing error This bit is set by hardware when a de-synchronization, excessive noise or a break character is detected. It is cleared by software, writing 1 to the FECF bit in the USART_ICR register. When transmitting data in Smartcard mode, this bit is set when the maximum number of transmit attempts is reached without success (the card NACKs the data frame). An interrupt is generated if EIEÂ =Â 1 in the USART_CR1 register. Note: This error is associated with the character in the USART_RDR..
Allowed values:
0x0: B_0x0: No Framing error is detected
0x1: B_0x1: Framing error or break character is detected
Bit 2: Noise detection flag This bit is set by hardware when noise is detected on a received frame. It is cleared by software, writing 1 to the NECF bit in the USART_ICR register. Note: This bit does not generate an interrupt as it appears at the same time as the RXFNE bit which itself generates an interrupt. An interrupt is generated when the NE flag is set during multi buffer communication if the EIE bit is set. When the line is noise-free, the NE flag can be disabled by programming the ONEBIT bit to 1 to increase the USART tolerance to deviations (Refer to Tolerance of the USART receiver to clock deviation on page 861). This error is associated with the character in the USART_RDR..
Allowed values:
0x0: B_0x0: No noise is detected
0x1: B_0x1: Noise is detected
Bit 3: Overrun error This bit is set by hardware when the data currently being received in the shift register is ready to be transferred into the USART_RDR register while RXFF = 1. It is cleared by a software, writing 1 to the ORECF, in the USART_ICR register. An interrupt is generated if RXFNEIEÂ =Â 1 or EIE = 1 in the USART_CR1 register. Note: When this bit is set, the USART_RDR register content is not lost but the shift register is overwritten. An interrupt is generated if the ORE flag is set during multi buffer communication if the EIE bit is set. This bit is permanently forced to 0 (no overrun detection) when the bit OVRDIS is set in the USART_CR3 register..
Allowed values:
0x0: B_0x0: No overrun error
0x1: B_0x1: Overrun error is detected
Bit 4: Idle line detected This bit is set by hardware when an Idle Line is detected. An interrupt is generated if IDLEIEÂ =Â 1 in the USART_CR1 register. It is cleared by software, writing 1 to the IDLECF in the USART_ICR register. Note: The IDLE bit is not set again until the RXFNE bit has been set (i.e. a new idle line occurs). If Mute mode is enabled (MMEÂ =Â 1), IDLE is set if the USART is not mute (RWUÂ =Â 0), whatever the Mute mode selected by the WAKE bit. If RWUÂ =Â 1, IDLE is not set..
Allowed values:
0x0: B_0x0: No Idle line is detected
0x1: B_0x1: Idle line is detected
Bit 5: RXFIFO not empty RXFNE bit is set by hardware when the RXFIFO is not empty, meaning that data can be read from the USART_RDR register. Every read operation from the USART_RDR frees a location in the RXFIFO. RXFNE is cleared when the RXFIFO is empty. The RXFNE flag can also be cleared by writing 1 to the RXFRQ in the USART_RQR register. An interrupt is generated if RXFNEIEÂ =Â 1 in the USART_CR1 register..
Allowed values:
0x0: B_0x0: Data is not received
0x1: B_0x1: Received data is ready to be read.
Bit 6: Transmission complete This bit indicates that the last data written in the USART_TDR has been transmitted out of the shift register. It is set by hardware when the transmission of a frame containing data is complete and when TXFE is set. An interrupt is generated if TCIEÂ =Â 1 in the USART_CR1 register. TC bit is is cleared by software, by writing 1 to the TCCF in the USART_ICR register or by a write to the USART_TDR register. Note: If TE bit is reset and no transmission is on going, the TC bit is immediately set..
Allowed values:
0x0: B_0x0: Transmission is not complete
0x1: B_0x1: Transmission is complete
Bit 7: TXFIFO not full TXFNF is set by hardware when TXFIFO is not full meaning that data can be written in the USART_TDR. Every write operation to the USART_TDR places the data in the TXFIFO. This flag remains set until the TXFIFO is full. When the TXFIFO is full, this flag is cleared indicating that data can not be written into the USART_TDR. An interrupt is generated if the TXFNFIE bit =1 in the USART_CR1 register. Note: The TXFNF is kept reset during the flush request until TXFIFO is empty. After sending the flush request (by setting TXFRQ bit), the flag TXFNF should be checked prior to writing in TXFIFO (TXFNF and TXFE are set at the same time). This bit is used during single buffer transmission..
Allowed values:
0x0: B_0x0: Transmit FIFO is full
0x1: B_0x1: Transmit FIFO is not full
Bit 8: LIN break detection flag This bit is set by hardware when the LIN break is detected. It is cleared by software, by writing 1 to the LBDCF in the USART_ICR. An interrupt is generated if LBDIE = 1 in the USART_CR2 register. Note: If the USART does not support LIN mode, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: LIN Break not detected
0x1: B_0x1: LIN break detected
Bit 9: CTS interrupt flag This bit is set by hardware when the nCTS input toggles, if the CTSE bit is set. It is cleared by software, by writing 1 to the CTSCF bit in the USART_ICR register. An interrupt is generated if CTSIEÂ =Â 1 in the USART_CR3 register. Note: If the hardware flow control feature is not supported, this bit is reserved and kept at reset value..
Allowed values:
0x0: B_0x0: No change occurred on the nCTS status line
0x1: B_0x1: A change occurred on the nCTS status line
Bit 11: Receiver timeout This bit is set by hardware when the timeout value, programmed in the RTOR register has lapsed, without any communication. It is cleared by software, writing 1 to the RTOCF bit in the USART_ICR register. An interrupt is generated if RTOIEÂ =Â 1 in the USART_CR2 register. In Smartcard mode, the timeout corresponds to the CWT or BWT timings. Note: If a time equal to the value programmed in RTOR register separates 2 characters, RTOF is not set. If this time exceeds this value + 2 sample times (2/16 or 2/8, depending on the oversampling method), RTOF flag is set. The counter counts even if RE = 0 but RTOF is set only when RE = 1. If the timeout has already elapsed when RE is set, then RTOF is set. If the USART does not support the Receiver timeout feature, this bit is reserved and kept at reset value..
Allowed values:
0x0: B_0x0: Timeout value not reached
0x1: B_0x1: Timeout value reached without any data reception
Bit 12: End of block flag This bit is set by hardware when a complete block has been received (for example TÂ =Â 1 Smartcard mode). The detection is done when the number of received bytes (from the start of the block, including the prologue) is equal or greater than BLEN + 4. An interrupt is generated if the EOBIEÂ =Â 1 in the USART_CR2 register. It is cleared by software, writing 1 to the EOBCF in the USART_ICR register. Note: If Smartcard mode is not supported, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: End of Block not reached
0x1: B_0x1: End of Block (number of characters) reached
Bit 13: SPI slave underrun error flag In slave transmission mode, this flag is set when the first clock pulse for data transmission appears while the software has not yet loaded any value into USART_TDR. This flag is reset by setting UDRCF bit in the USART_ICR register. Note: If the USART does not support the SPI slave mode, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: No underrun error
0x1: B_0x1: underrun error
Bit 14: Auto baud rate error This bit is set by hardware if the baud rate measurement failed (baud rate out of range or character comparison failed) It is cleared by software, by writing 1 to the ABRRQ bit in the USART_CR3 register. Note: If the USART does not support the auto baud rate feature, this bit is reserved and kept at reset value..
Bit 15: Auto baud rate flag This bit is set by hardware when the automatic baud rate has been set (RXFNE is also set, generating an interrupt if RXFNEIE = 1) or when the auto baud rate operation was completed without success (ABREÂ =Â 1) (ABRE, RXFNE and FE are also set in this case) It is cleared by software, in order to request a new auto baud rate detection, by writing 1 to the ABRRQ in the USART_RQR register. Note: If the USART does not support the auto baud rate feature, this bit is reserved and kept at reset value..
Bit 16: Busy flag This bit is set and reset by hardware. It is active when a communication is ongoing on the RX line (successful start bit detected). It is reset at the end of the reception (successful or not)..
Allowed values:
0x0: B_0x0: USART is idle (no reception)
0x1: B_0x1: Reception on going
Bit 17: Character match flag This bit is set by hardware, when a the character defined by ADD[7:0] is received. It is cleared by software, writing 1 to the CMCF in the USART_ICR register. An interrupt is generated if CMIEÂ =Â 1in the USART_CR1 register..
Allowed values:
0x0: B_0x0: No Character match detected
0x1: B_0x1: Character Match detected
Bit 18: Send break flag This bit indicates that a send break character was requested. It is set by software, by writing 1 to the SBKRQ bit in the USART_CR3 register. It is automatically reset by hardware during the stop bit of break transmission..
Allowed values:
0x0: B_0x0: Break character transmitted
0x1: B_0x1: Break character requested by setting SBKRQ bit in USART_RQR register
Bit 19: Receiver wakeup from Mute mode This bit indicates if the USART is in Mute mode. It is cleared/set by hardware when a wakeup/mute sequence is recognized. The Mute mode control sequence (address or IDLE) is selected by the WAKE bit in the USART_CR1 register. When wakeup on IDLE mode is selected, this bit can only be set by software, writing 1 to the MMRQ bit in the USART_RQR register. Note: If the USART does not support the wakeup from Stop feature, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Receiver in active mode
0x1: B_0x1: Receiver in Mute mode
Bit 20: Wakeup from low-power mode flag This bit is set by hardware, when a wakeup event is detected. The event is defined by the WUS bitfield. It is cleared by software, writing a 1 to the WUCF in the USART_ICR register. An interrupt is generated if WUFIEÂ =Â 1 in the USART_CR3 register. Note: When UESM is cleared, WUF flag is also cleared. If the USART does not support the wakeup from Stop feature, this bit is reserved and kept at reset value. Refer to ..
Bit 21: Transmit enable acknowledge flag This bit is set/reset by hardware, when the Transmit Enable value is taken into account by the USART. It can be used when an idle frame request is generated by writing TEÂ =Â 0, followed by TEÂ =Â 1 in the USART_CR1 register, in order to respect the TEÂ =Â 0 minimum period..
Bit 22: Receive enable acknowledge flag This bit is set/reset by hardware, when the Receive Enable value is taken into account by the USART. It can be used to verify that the USART is ready for reception before entering low-power mode. Note: If the USART does not support the wakeup from Stop feature, this bit is reserved and kept at reset value. Refer to ..
Bit 23: TXFIFO empty This bit is set by hardware when TXFIFO is empty. When the TXFIFO contains at least one data, this flag is cleared. The TXFE flag can also be set by writing 1 to the bit TXFRQ (bit 4) in the USART_RQR register. An interrupt is generated if the TXFEIE bit  = 1 (bit 30) in the USART_CR1 register..
Allowed values:
0x0: B_0x0: TXFIFO not empty.
0x1: B_0x1: TXFIFO empty.
Bit 24: RXFIFO full This bit is set by hardware when the number of received data corresponds to RXFIFO size + 1 (RXFIFO full + 1 data in the USART_RDR register. An interrupt is generated if the RXFFIE bit  = 1 in the USART_CR1 register..
Allowed values:
0x0: B_0x0: RXFIFO not full.
0x1: B_0x1: RXFIFO Full.
Bit 25: Transmission complete before guard time flag This bit is set when the last data written in the USART_TDR has been transmitted correctly out of the shift register. It is set by hardware in Smartcard mode, if the transmission of a frame containing data is complete and if the smartcard did not send back any NACK. An interrupt is generated if TCBGTIE = 1 in the USART_CR3 register. This bit is cleared by software, by writing 1 to the TCBGTCF in the USART_ICR register or by a write to the USART_TDR register. Note: If the USART does not support the Smartcard mode, this bit is reserved and kept at reset value. If the USART supports the Smartcard mode and the Smartcard mode is enabled, the TCBGT reset value is '1â. Refer to on page 835..
Allowed values:
0x0: B_0x0: Transmission is not complete or transmission is complete unsuccessfully (i.e. a NACK is received from the card)
0x1: B_0x1: Transmission is complete successfully (before Guard time completion and there is no NACK from the smart card).
Bit 26: RXFIFO threshold flag This bit is set by hardware when the threshold programmed in RXFTCFG in USART_CR3 register is reached. This means that there are (RXFTCFG - 1) data in the Receive FIFO and one data in the USART_RDR register. An interrupt is generated if the RXFTIE bit  = 1 (bit 27) in the USART_CR3 register. Note: When the RXFTCFG threshold is configured to '101â, RXFT flag is set if 16 data are available i.e. 15 data in the RXFIFO and 1 data in the USART_RDR. Consequently, the 17th received data does not cause an overrun error. The overrun error occurs after receiving the 18th data..
Allowed values:
0x0: B_0x0: Receive FIFO does not reach the programmed threshold.
0x1: B_0x1: Receive FIFO reached the programmed threshold.
Bit 27: TXFIFO threshold flag This bit is set by hardware when the TXFIFO reaches the threshold programmed in TXFTCFG of USART_CR3 register i.e. the TXFIFO contains TXFTCFG empty locations. An interrupt is generated if the TXFTIE bit  = 1 (bit 31) in the USART_CR3 register..
Allowed values:
0x0: B_0x0: TXFIFO does not reach the programmed threshold.
0x1: B_0x1: TXFIFO reached the programmed threshold.
Receive data register
Offset: 0x24, reset: 0x0000, access: read-only
1/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
RDR
r |
|||||||||||||||
Transmit data register
Offset: 0x28, reset: 0x0000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
TDR
rw |
|||||||||||||||
Prescaler register
Offset: 0x2C, reset: 0x0000, access: read-write
1/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
PRESCALER
rw |
|||||||||||||||
Bits 0-3: Clock prescaler The USART input clock can be divided by a prescaler factor: Remaining combinations: Reserved Note: When PRESCALER is programmed with a value different of the allowed ones, programmed prescaler value is 1011 i.e. input clock divided by 256..
Allowed values:
0x0: B_0x0: input clock not divided
0x1: B_0x1: input clock divided by 2
0x2: B_0x2: input clock divided by 4
0x3: B_0x3: input clock divided by 6
0x4: B_0x4: input clock divided by 8
0x5: B_0x5: input clock divided by 10
0x6: B_0x6: input clock divided by 12
0x7: B_0x7: input clock divided by 16
0x8: B_0x8: input clock divided by 32
0x9: B_0x9: input clock divided by 64
0xA: B_0xA: input clock divided by 128
0xB: B_0xB: input clock divided by 256
0x40013C00: Universal synchronous asynchronous receiver transmitter
136/170 fields covered. Toggle Registers
| Offset | Name | 31 |
30 |
29 |
28 |
27 |
26 |
25 |
24 |
23 |
22 |
21 |
20 |
19 |
18 |
17 |
16 |
15 |
14 |
13 |
12 |
11 |
10 |
9 |
8 |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x0 | CR1_FIFO_DISABLED | ||||||||||||||||||||||||||||||||
| 0x0 | CR1_FIFO_ENABLED | ||||||||||||||||||||||||||||||||
| 0x4 | CR2 | ||||||||||||||||||||||||||||||||
| 0x8 | CR3 | ||||||||||||||||||||||||||||||||
| 0xC | BRR | ||||||||||||||||||||||||||||||||
| 0x10 | GTPR | ||||||||||||||||||||||||||||||||
| 0x14 | RTOR | ||||||||||||||||||||||||||||||||
| 0x18 | RQR | ||||||||||||||||||||||||||||||||
| 0x1C | ISR_FIFO_DISABLED | ||||||||||||||||||||||||||||||||
| 0x1C | ISR_FIFO_ENABLED | ||||||||||||||||||||||||||||||||
| 0x20 | ICR | ||||||||||||||||||||||||||||||||
| 0x24 | RDR | ||||||||||||||||||||||||||||||||
| 0x28 | TDR | ||||||||||||||||||||||||||||||||
| 0x2C | PRESC | ||||||||||||||||||||||||||||||||
Control register 1
Offset: 0x0, reset: 0x0000, access: read-write
18/22 fields covered.
Bit 0: USART enable When this bit is cleared, the USART prescalers and outputs are stopped immediately, and all current operations are discarded. The USART configuration is kept, but all the USART_ISR status flags are reset. This bit is set and cleared by software. Note: To enter low-power mode without generating errors on the line, the TE bit must be previously reset and the software must wait for the TC bit in the USART_ISR to be set before resetting the UE bit. The DMA requests are also reset when UE = 0 so the DMA channel must be disabled before resetting the UE bit. In Smartcard mode, (SCEN = 1), the SCLK is always available when CLKEN = 1, regardless of the UE bit value..
Allowed values:
0x0: B_0x0: USART prescaler and outputs disabled, low-power mode
0x1: B_0x1: USART enabled
Bit 1: USART enable in low-power mode When this bit is cleared, the USART cannot wake up the MCU from low-power mode. When this bit is set, the USART can wake up the MCU from low-power mode. This bit is set and cleared by software. Note: It is recommended to set the UESM bit just before entering low-power mode and clear it when exit from low-power mode. If the USART does not support the wakeup from Stop feature, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: USART not able to wake up the MCU from low-power mode.
0x1: B_0x1: USART able to wake up the MCU from low-power mode.
Bit 3: Transmitter enable This bit enables the transmitter. It is set and cleared by software. Note: During transmission, a low pulse on the TE bit ('0â followed by '1â) sends a preamble (idle line) after the current word, except in Smartcard mode. In order to generate an idle character, the TE must not be immediately written to '1â. To ensure the required duration, the software can poll the TEACK bit in the USART_ISR register. In Smartcard mode, when TE is set, there is a 1 bit-time delay before the transmission starts..
Allowed values:
0x0: B_0x0: Transmitter is disabled
0x1: B_0x1: Transmitter is enabled
Bit 9: Parity selection This bit selects the odd or even parity when the parity generation/detection is enabled (PCE bit set). It is set and cleared by software. The parity is selected after the current byte. This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: Even parity
0x1: B_0x1: Odd parity
Bit 10: Parity control enable This bit selects the hardware parity control (generation and detection). When the parity control is enabled, the computed parity is inserted at the MSB position (9th bit if MÂ =Â 1; 8th bit if MÂ =Â 0) and the parity is checked on the received data. This bit is set and cleared by software. Once it is set, PCE is active after the current byte (in reception and in transmission). This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: Parity control disabled
0x1: B_0x1: Parity control enabled
Bit 13: Mute mode enable This bit enables the USART Mute mode function. When set, the USART can switch between active and Mute mode, as defined by the WAKE bit. It is set and cleared by software..
Allowed values:
0x0: B_0x0: Receiver in active mode permanently
0x1: B_0x1: Receiver can switch between Mute mode and active mode.
Bits 16-20: Driver Enable deassertion time This 5-bit value defines the time between the end of the last stop bit, in a transmitted message, and the de-activation of the DE (Driver Enable) signal. It is expressed in sample time units (1/8 or 1/16 bit time, depending on the oversampling rate). If the USART_TDR register is written during the DEDT time, the new data is transmitted only when the DEDT and DEAT times have both elapsed. This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If the Driver Enable feature is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Bits 21-25: Driver Enable assertion time This 5-bit value defines the time between the activation of the DE (Driver Enable) signal and the beginning of the start bit. It is expressed in sample time units (1/8 or 1/16 bit time, depending on the oversampling rate). This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If the Driver Enable feature is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Bit 26: Receiver timeout interrupt enable This bit is set and cleared by software. Note: If the USART does not support the Receiver timeout feature, this bit is reserved and must be kept at reset value. ..
Allowed values:
0x0: B_0x0: Interrupt inhibited
0x1: B_0x1: USART interrupt generated when the RTOF bit is set in the USART_ISR register.
Bit 27: End of Block interrupt enable This bit is set and cleared by software. Note: If the USART does not support Smartcard mode, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Interrupt inhibited
0x1: B_0x1: USART interrupt generated when the EOBF flag is set in the USART_ISR register
Bit 28: Word length This bit must be used in conjunction with bit 12 (M0) to determine the word length. It is set or cleared by software. M[1:0] = '00â: 1 start bit, 8 Data bits, n Stop bit M[1:0] = '01â: 1 start bit, 9 Data bits, n Stop bit M[1:0] = '10â: 1 start bit, 7 Data bits, n Stop bit This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: In 7-bits data length mode, the Smartcard mode, LIN master mode and Auto baud rate (0x7F and 0x55 frames detection) are not supported..
Bit 29: FIFO mode enable This bit is set and cleared by software. This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: FIFO mode can be used on standard UART communication, in SPI master/slave mode and in Smartcard modes only. It must not be enabled in IrDA and LIN modes..
Allowed values:
0x0: B_0x0: FIFO mode is disabled.
0x1: B_0x1: FIFO mode is enabled.
Control register 1
Offset: 0x0, reset: 0x0000, access: read-write
20/24 fields covered.
Bit 0: USART enable When this bit is cleared, the USART prescalers and outputs are stopped immediately, and all current operations are discarded. The USART configuration is kept, but all the USART_ISR status flags are reset. This bit is set and cleared by software. Note: To enter low-power mode without generating errors on the line, the TE bit must be previously reset and the software must wait for the TC bit in the USART_ISR to be set before resetting the UE bit. The DMA requests are also reset when UE = 0 so the DMA channel must be disabled before resetting the UE bit. In Smartcard mode, (SCEN = 1), the SCLK is always available when CLKEN = 1, regardless of the UE bit value..
Allowed values:
0x0: B_0x0: USART prescaler and outputs disabled, low-power mode
0x1: B_0x1: USART enabled
Bit 1: USART enable in low-power mode When this bit is cleared, the USART cannot wake up the MCU from low-power mode. When this bit is set, the USART can wake up the MCU from low-power mode. This bit is set and cleared by software. Note: It is recommended to set the UESM bit just before entering low-power mode and clear it when exit from low-power mode. If the USART does not support the wakeup from Stop feature, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: USART not able to wake up the MCU from low-power mode.
0x1: B_0x1: USART able to wake up the MCU from low-power mode.
Bit 3: Transmitter enable This bit enables the transmitter. It is set and cleared by software. Note: During transmission, a low pulse on the TE bit ('0â followed by '1â) sends a preamble (idle line) after the current word, except in Smartcard mode. In order to generate an idle character, the TE must not be immediately written to '1â. To ensure the required duration, the software can poll the TEACK bit in the USART_ISR register. In Smartcard mode, when TE is set, there is a 1 bit-time delay before the transmission starts..
Allowed values:
0x0: B_0x0: Transmitter is disabled
0x1: B_0x1: Transmitter is enabled
Bit 9: Parity selection This bit selects the odd or even parity when the parity generation/detection is enabled (PCE bit set). It is set and cleared by software. The parity is selected after the current byte. This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: Even parity
0x1: B_0x1: Odd parity
Bit 10: Parity control enable This bit selects the hardware parity control (generation and detection). When the parity control is enabled, the computed parity is inserted at the MSB position (9th bit if MÂ =Â 1; 8th bit if MÂ =Â 0) and the parity is checked on the received data. This bit is set and cleared by software. Once it is set, PCE is active after the current byte (in reception and in transmission). This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: Parity control disabled
0x1: B_0x1: Parity control enabled
Bit 13: Mute mode enable This bit enables the USART Mute mode function. When set, the USART can switch between active and Mute mode, as defined by the WAKE bit. It is set and cleared by software..
Allowed values:
0x0: B_0x0: Receiver in active mode permanently
0x1: B_0x1: Receiver can switch between Mute mode and active mode.
Bits 16-20: Driver Enable deassertion time This 5-bit value defines the time between the end of the last stop bit, in a transmitted message, and the de-activation of the DE (Driver Enable) signal. It is expressed in sample time units (1/8 or 1/16 bit time, depending on the oversampling rate). If the USART_TDR register is written during the DEDT time, the new data is transmitted only when the DEDT and DEAT times have both elapsed. This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If the Driver Enable feature is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Bits 21-25: Driver Enable assertion time This 5-bit value defines the time between the activation of the DE (Driver Enable) signal and the beginning of the start bit. It is expressed in sample time units (1/8 or 1/16 bit time, depending on the oversampling rate). This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If the Driver Enable feature is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Bit 26: Receiver timeout interrupt enable This bit is set and cleared by software. Note: If the USART does not support the Receiver timeout feature, this bit is reserved and must be kept at reset value. ..
Allowed values:
0x0: B_0x0: Interrupt inhibited
0x1: B_0x1: USART interrupt generated when the RTOF bit is set in the USART_ISR register.
Bit 27: End of Block interrupt enable This bit is set and cleared by software. Note: If the USART does not support Smartcard mode, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Interrupt inhibited
0x1: B_0x1: USART interrupt generated when the EOBF flag is set in the USART_ISR register
Bit 28: Word length This bit must be used in conjunction with bit 12 (M0) to determine the word length. It is set or cleared by software. M[1:0] = '00â: 1 start bit, 8 Data bits, n Stop bit M[1:0] = '01â: 1 start bit, 9 Data bits, n Stop bit M[1:0] = '10â: 1 start bit, 7 Data bits, n Stop bit This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: In 7-bits data length mode, the Smartcard mode, LIN master mode and Auto baud rate (0x7F and 0x55 frames detection) are not supported..
Bit 29: FIFO mode enable This bit is set and cleared by software. This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: FIFO mode can be used on standard UART communication, in SPI master/slave mode and in Smartcard modes only. It must not be enabled in IrDA and LIN modes..
Allowed values:
0x0: B_0x0: FIFO mode is disabled.
0x1: B_0x1: FIFO mode is enabled.
Control register 2
Offset: 0x4, reset: 0x0000, access: read-write
19/20 fields covered.
Bit 3: When the DIS_NSS bit is set, the NSS pin input is ignored. Note: When SPI slave mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: SPI slave selection depends on NSS input pin.
0x1: B_0x1: SPI slave is always selected and NSS input pin is ignored.
Bit 4: 7-bit Address Detection/4-bit Address Detection This bit is for selection between 4-bit address detection or 7-bit address detection. This bit can only be written when the USART is disabled (UEÂ =Â 0) Note: In 7-bit and 9-bit data modes, the address detection is done on 6-bit and 8-bit address (ADD[5:0] and ADD[7:0]) respectively..
Allowed values:
0x0: B_0x0: 4-bit address detection
0x1: B_0x1: 7-bit address detection (in 8-bit data mode)
Bit 5: LIN break detection length This bit is for selection between 11 bit or 10 bit break detection. This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If LIN mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: 10-bit break detection
0x1: B_0x1: 11-bit break detection
Bit 6: LIN break detection interrupt enable Break interrupt mask (break detection using break delimiter). Note: If LIN mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Interrupt is inhibited
0x1: B_0x1: An interrupt is generated whenever LBDF = 1 in the USART_ISR register
Bit 8: Last bit clock pulse This bit is used to select whether the clock pulse associated with the last data bit transmitted (MSB) has to be output on the SCLK pin in synchronous mode. The last bit is the 7th or 8th or 9th data bit transmitted depending on the 7 or 8 or 9 bit format selected by the M bit in the USART_CR1 register. This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If synchronous mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: The clock pulse of the last data bit is not output to the SCLK pin
0x1: B_0x1: The clock pulse of the last data bit is output to the SCLK pin
Bit 9: Clock phase This bit is used to select the phase of the clock output on the SCLK pin in synchronous mode. It works in conjunction with the CPOL bit to produce the desired clock/data relationship (see and ) This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If synchronous mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: The first clock transition is the first data capture edge
0x1: B_0x1: The second clock transition is the first data capture edge
Bit 10: Clock polarity This bit enables the user to select the polarity of the clock output on the SCLK pin in synchronous mode. It works in conjunction with the CPHA bit to produce the desired clock/data relationship This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If synchronous mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Steady low value on SCLK pin outside transmission window
0x1: B_0x1: Steady high value on SCLK pin outside transmission window
Bit 11: Clock enable This bit enables the user to enable the SCLK pin. This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If neither synchronous mode nor Smartcard mode is supported, this bit is reserved and must be kept at reset value. Refer to . In Smartcard mode, in order to provide correctly the SCLK clock to the smartcard, the steps below must be respected: UE = 0 SCEN = 1 GTPR configuration CLKEN= 1 UE = 1.
Allowed values:
0x0: B_0x0: SCLK pin disabled
0x1: B_0x1: SCLK pin enabled
Bit 14: LIN mode enable This bit is set and cleared by software. The LIN mode enables the capability to send LIN synchronous breaks (13 low bits) using the SBKRQ bit in the USART_CR1 register, and to detect LIN Sync breaks. This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If the USART does not support LIN mode, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: LIN mode disabled
0x1: B_0x1: LIN mode enabled
Bit 15: Swap TX/RX pins This bit is set and cleared by software. This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: TX/RX pins are used as defined in standard pinout
0x1: B_0x1: The TX and RX pins functions are swapped. This enables to work in the case of a cross-wired connection to another UART.
Bit 16: RX pin active level inversion This bit is set and cleared by software. This enables the use of an external inverter on the RX line. This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: RX pin signal works using the standard logic levels (VDD =1/idle, Gnd = 0/mark)
0x1: B_0x1: RX pin signal values are inverted (VDD =0/mark, Gnd = 1/idle).
Bit 17: TX pin active level inversion This bit is set and cleared by software. This enables the use of an external inverter on the TX line. This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: TX pin signal works using the standard logic levels (VDD =1/idle, Gnd = 0/mark)
0x1: B_0x1: TX pin signal values are inverted (VDD =0/mark, Gnd = 1/idle).
Bit 18: Binary data inversion This bit is set and cleared by software. This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: Logical data from the data register are send/received in positive/direct logic. (1 = H, 0 = L)
0x1: B_0x1: Logical data from the data register are send/received in negative/inverse logic. (1 = L, 0 = H). The parity bit is also inverted.
Bit 19: Most significant bit first This bit is set and cleared by software. This bitfield can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: data is transmitted/received with data bit 0 first, following the start bit.
0x1: B_0x1: data is transmitted/received with the MSB (bit 7/8) first, following the start bit.
Bit 20: Auto baud rate enable This bit is set and cleared by software. Note: If the USART does not support the auto baud rate feature, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Auto baud rate detection is disabled.
0x1: B_0x1: Auto baud rate detection is enabled.
Bits 21-22: Auto baud rate mode These bits are set and cleared by software. This bitfield can only be written when ABREN = 0 or the USART is disabled (UEÂ =Â 0). Note: If DATAINVÂ =Â 1 and/or MSBFIRSTÂ =Â 1 the patterns must be the same on the line, for example 0xAA for MSBFIRST) If the USART does not support the auto baud rate feature, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Measurement of the start bit is used to detect the baud rate.
0x1: B_0x1: Falling edge to falling edge measurement (the received frame must start with a single bit = 1 and Frame = Start10xxxxxx)
0x2: B_0x2: 0x7F frame detection.
0x3: B_0x3: 0x55 frame detection
Bit 23: Receiver timeout enable This bit is set and cleared by software. When this feature is enabled, the RTOF flag in the USART_ISR register is set if the RX line is idle (no reception) for the duration programmed in the RTOR (receiver timeout register). Note: If the USART does not support the Receiver timeout feature, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Receiver timeout feature disabled.
0x1: B_0x1: Receiver timeout feature enabled.
Bits 24-31: Address of the USART node ADD[7:4]: These bits give the address of the USART node or a character code to be recognized. They are used to wake up the MCU with 7-bit address mark detection in multiprocessor communication during Mute mode or low-power mode. The MSB of the character sent by the transmitter should be equal to 1. They can also be used for character detection during normal reception, Mute mode inactive (for example, end of block detection in ModBus protocol). In this case, the whole received character (8-bit) is compared to the ADD[7:0] value and CMF flag is set on match. These bits can only be written when reception is disabled (RE = 0) or the USART is disabled (UEÂ =Â 0). ADD[3:0]: These bits give the address of the USART node or a character code to be recognized. They are used for wakeup with address mark detection, in multiprocessor communication during Mute mode or low-power mode. These bits can only be written when reception is disabled (RE = 0) or the USART is disabled (UEÂ =Â 0)..
Control register 3
Offset: 0x8, reset: 0x0000, access: read-write
24/24 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
TXFTCFG
rw |
RXFTIE
rw |
RXFTCFG
rw |
TCBGTIE
rw |
TXFTIE
rw |
WUFIE
rw |
WUS
rw |
SCARCNT
rw |
||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
DEP
rw |
DEM
rw |
DDRE
rw |
OVRDIS
rw |
ONEBIT
rw |
CTSIE
rw |
CTSE
rw |
RTSE
rw |
DMAT
rw |
DMAR
rw |
SCEN
rw |
NACK
rw |
HDSEL
rw |
IRLP
rw |
IREN
rw |
EIE
rw |
Bit 0: Error interrupt enable Error Interrupt Enable Bit is required to enable interrupt generation in case of a framing error, overrun error noise flag or SPI slave underrun error (FEÂ =Â 1 or OREÂ =Â 1 or NEÂ =Â 1 or UDR = 1 in the USART_ISR register)..
Allowed values:
0x0: B_0x0: Interrupt inhibited
0x1: B_0x1: interrupt generated when FE = 1 or ORE = 1 or NE = 1 or UDR = 1 (in SPI slave mode) in the USART_ISR register.
Bit 1: IrDA mode enable This bit is set and cleared by software. This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If IrDA mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: IrDA disabled
0x1: B_0x1: IrDA enabled
Bit 2: IrDA low-power This bit is used for selecting between normal and low-power IrDA modes This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If IrDA mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Normal mode
0x1: B_0x1: Low-power mode
Bit 4: Smartcard NACK enable This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If the USART does not support Smartcard mode, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: NACK transmission in case of parity error is disabled
0x1: B_0x1: NACK transmission during parity error is enabled
Bit 5: Smartcard mode enable This bit is used for enabling Smartcard mode. This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If the USART does not support Smartcard mode, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Smartcard Mode disabled
0x1: B_0x1: Smartcard Mode enabled
Bit 8: RTS enable This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If the hardware flow control feature is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: RTS hardware flow control disabled
0x1: B_0x1: RTS output enabled, data is only requested when there is space in the receive buffer. The transmission of data is expected to cease after the current character has been transmitted. The nRTS output is asserted (pulled to 0) when data can be received.
Bit 9: CTS enable This bit can only be written when the USART is disabled (UEÂ =Â 0) Note: If the hardware flow control feature is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: CTS hardware flow control disabled
0x1: B_0x1: CTS mode enabled, data is only transmitted when the nCTS input is asserted (tied to 0). If the nCTS input is deasserted while data is being transmitted, then the transmission is completed before stopping. If data is written into the data register while nCTS is asserted, the transmission is postponed until nCTS is asserted.
Bit 11: One sample bit method enable This bit enables the user to select the sample method. When the one sample bit method is selected the noise detection flag (NE) is disabled. This bit can only be written when the USART is disabled (UEÂ =Â 0)..
Allowed values:
0x0: B_0x0: Three sample bit method
0x1: B_0x1: One sample bit method
Bit 12: Overrun Disable This bit is used to disable the receive overrun detection. the ORE flag is not set and the new received data overwrites the previous content of the USART_RDR register. When FIFO mode is enabled, the RXFIFO is bypassed and data is written directly in USART_RDR register. Even when FIFO management is enabled, the RXNE flag is to be used. This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: This control bit enables checking the communication flow w/o reading the data.
Allowed values:
0x0: B_0x0: Overrun Error Flag, ORE, is set when received data is not read before receiving new data.
0x1: B_0x1: Overrun functionality is disabled. If new data is received while the RXNE flag is still set
Bit 13: DMA Disable on Reception Error This bit can only be written when the USART is disabled (UE=0). Note: The reception errors are: parity error, framing error or noise error..
Allowed values:
0x0: B_0x0: DMA is not disabled in case of reception error. The corresponding error flag is set but RXNE is kept 0 preventing from overrun. As a consequence, the DMA request is not asserted, so the erroneous data is not transferred (no DMA request), but next correct received data is transferred (used for Smartcard mode).
0x1: B_0x1: DMA is disabled following a reception error. The corresponding error flag is set, as well as RXNE. The DMA request is masked until the error flag is cleared. This means that the software must first disable the DMA request (DMAR = 0) or clear RXNE/RXFNE is case FIFO mode is enabled) before clearing the error flag.
Bit 14: Driver enable mode This bit enables the user to activate the external transceiver control, through the DE signal. This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If the Driver Enable feature is not supported, this bit is reserved and must be kept at reset value. ..
Allowed values:
0x0: B_0x0: DE function is disabled.
0x1: B_0x1: DE function is enabled. The DE signal is output on the RTS pin.
Bit 15: Driver enable polarity selection This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If the Driver Enable feature is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: DE signal is active high.
0x1: B_0x1: DE signal is active low.
Bits 17-19: Smartcard auto-retry count This bitfield specifies the number of retries for transmission and reception in Smartcard mode. In transmission mode, it specifies the number of automatic retransmission retries, before generating a transmission error (FE bit set). In reception mode, it specifies the number or erroneous reception trials, before generating a reception error (RXNE/RXFNE and PE bits set). This bitfield must be programmed only when the USART is disabled (UEÂ =Â 0). When the USART is enabled (UEÂ =Â 1), this bitfield may only be written to 0x0, in order to stop retransmission. Note: If Smartcard mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: retransmission disabled - No automatic retransmission in transmit mode.
0x1: B_0x1: number of automatic retransmission attempts (before signaling error)
0x2: B_0x2: number of automatic retransmission attempts (before signaling error)
0x3: B_0x3: number of automatic retransmission attempts (before signaling error)
0x4: B_0x4: number of automatic retransmission attempts (before signaling error)
0x5: B_0x5: number of automatic retransmission attempts (before signaling error)
0x6: B_0x6: number of automatic retransmission attempts (before signaling error)
0x7: B_0x7: number of automatic retransmission attempts (before signaling error)
Bits 20-21: Wakeup from low-power mode interrupt flag selection This bitfield specifies the event which activates the WUF (Wakeup from low-power mode flag). This bitfield can only be written when the USART is disabled (UE = 0). If the USART does not support the wakeup from Stop feature, this bit is reserved and must be kept at reset value. Refer to page 835..
Allowed values:
0x0: B_0x0: WUF active on address match (as defined by ADD[7:0] and ADDM7)
0x2: B_0x2: WUF active on start bit detection
0x3: B_0x3: WUF active on RXNE/RXFNE.
Bit 22: Wakeup from low-power mode interrupt enable This bit is set and cleared by software. Note: WUFIE must be set before entering in low-power mode. If the USART does not support the wakeup from Stop feature, this bit is reserved and must be kept at reset value. Refer to page 835..
Allowed values:
0x0: B_0x0: Interrupt inhibited
0x1: B_0x1: USART interrupt generated whenever WUF = 1 in the USART_ISR register
Bit 24: Transmission Complete before guard time, interrupt enable This bit is set and cleared by software. Note: If the USART does not support the Smartcard mode, this bit is reserved and must be kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Interrupt inhibited
0x1: B_0x1: USART interrupt generated whenever TCBGT=1 in the USART_ISR register
Bits 25-27: Receive FIFO threshold configuration Remaining combinations: Reserved.
Allowed values:
0x0: B_0x0: Receive FIFO reaches 1/8 of its depth
0x1: B_0x1: Receive FIFO reaches 1/4 of its depth
0x2: B_0x2: Receive FIFO reaches 1/2 of its depth
0x3: B_0x3: Receive FIFO reaches 3/4 of its depth
0x4: B_0x4: Receive FIFO reaches 7/8 of its depth
0x5: B_0x5: Receive FIFO becomes full
Bits 29-31: TXFIFO threshold configuration Remaining combinations: Reserved.
Allowed values:
0x0: B_0x0: TXFIFO reaches 1/8 of its depth
0x1: B_0x1: TXFIFO reaches 1/4 of its depth
0x2: B_0x2: TXFIFO reaches 1/2 of its depth
0x3: B_0x3: TXFIFO reaches 3/4 of its depth
0x4: B_0x4: TXFIFO reaches 7/8 of its depth
0x5: B_0x5: TXFIFO becomes empty
Baud rate register
Offset: 0xC, reset: 0x0000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
BRR
rw |
|||||||||||||||
Guard time and prescaler register
Offset: 0x10, reset: 0x0000, access: read-write
1/2 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
GT
rw |
PSC
rw |
||||||||||||||
Bits 0-7: Prescaler value In IrDA low-power and normal IrDA mode: PSC[7:0] = IrDA Normal and Low-Power baud rate PSC[7:0] is used to program the prescaler for dividing the USART source clock to achieve the low-power frequency: the source clock is divided by the value given in the register (8 significant bits): In Smartcard mode: PSC[4:0]Â =Â Prescaler value PSC[4:0] is used to program the prescaler for dividing the USART source clock to provide the Smartcard clock. The value given in the register (5 significant bits) is multiplied by 2 to give the division factor of the source clock frequency: ... 0010Â 0000: Divides the source clock by 32 (IrDA mode) ... 1111Â 1111: Divides the source clock by 255 (IrDA mode) This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: Bits [7:5] must be kept cleared if Smartcard mode is used. This bitfield is reserved and forced by hardware to '0â when the Smartcard and IrDA modes are not supported. Refer to ..
Allowed values:
0x0: B_0x0: Reserved - do not program this value
0x1: B_0x1: Divides the source clock by 1 (IrDA mode) / by 2 (Smarcard mode)
0x2: B_0x2: Divides the source clock by 2 (IrDA mode) / by 4 (Smartcard mode)
0x3: B_0x3: Divides the source clock by 3 (IrDA mode) / by 6 (Smartcard mode)
0x1F: B_0x1F: Divides the source clock by 31 (IrDA mode) / by 62 (Smartcard mode)
Bits 8-15: Guard time value This bitfield is used to program the Guard time value in terms of number of baud clock periods. This is used in Smartcard mode. The Transmission Complete flag is set after this guard time value. This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If Smartcard mode is not supported, this bit is reserved and must be kept at reset value. Refer to ..
Receiver timeout register
Offset: 0x14, reset: 0x0000, access: read-write
0/2 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
BLEN
rw |
RTO
rw |
||||||||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
RTO
rw |
|||||||||||||||
Request register
Offset: 0x18, reset: 0x0000, access: write-only
0/5 fields covered.
Bit 0: Auto baud rate request Writing 1 to this bit resets the ABRF flag in the USART_ISR and requests an automatic baud rate measurement on the next received data frame. Note: If the USART does not support the auto baud rate feature, this bit is reserved and must be kept at reset value. Refer to ..
Bit 1: Send break request Writing 1 to this bit sets the SBKF flag and request to send a BREAK on the line, as soon as the transmit machine is available. Note: When the application needs to send the break character following all previously inserted data, including the ones not yet transmitted, the software should wait for the TXE flag assertion before setting the SBKRQ bit..
Bit 4: Transmit data flush request When FIFO mode is disabled, writing '1â to this bit sets the TXE flag. This enables to discard the transmit data. This bit must be used only in Smartcard mode, when data have not been sent due to errors (NACK) and the FE flag is active in the USART_ISR register. If the USART does not support Smartcard mode, this bit is reserved and must be kept at reset value. When FIFO is enabled, TXFRQ bit is set to flush the whole FIFO. This sets the TXFE flag (Transmit FIFO empty, bit 23 in the USART_ISR register). Flushing the Transmit FIFO is supported in both UART and Smartcard modes. Note: In FIFO mode, the TXFNF flag is reset during the flush request until TxFIFO is empty in order to ensure that no data are written in the data register..
Interrupt & status register
Offset: 0x1C, reset: 0x000000C0, access: read-only
24/24 fields covered.
Bit 0: Parity error This bit is set by hardware when a parity error occurs in receiver mode. It is cleared by software, writing 1 to the PECF in the USART_ICR register. An interrupt is generated if PEIE = 1 in the USART_CR1 register..
Allowed values:
0x0: B_0x0: No parity error
0x1: B_0x1: Parity error
Bit 1: Framing error This bit is set by hardware when a de-synchronization, excessive noise or a break character is detected. It is cleared by software, writing 1 to the FECF bit in the USART_ICR register. When transmitting data in Smartcard mode, this bit is set when the maximum number of transmit attempts is reached without success (the card NACKs the data frame). An interrupt is generated if EIEÂ =Â 1 in the USART_CR1 register..
Allowed values:
0x0: B_0x0: No Framing error is detected
0x1: B_0x1: Framing error or break character is detected
Bit 2: Noise detection flag This bit is set by hardware when noise is detected on a received frame. It is cleared by software, writing 1 to the NECF bit in the USART_ICR register. Note: This bit does not generate an interrupt as it appears at the same time as the RXNE bit which itself generates an interrupt. An interrupt is generated when the NE flag is set during multi buffer communication if the EIE bit is set. When the line is noise-free, the NE flag can be disabled by programming the ONEBIT bit to 1 to increase the USART tolerance to deviations (Refer to Tolerance of the USART receiver to clock deviation on page 861)..
Allowed values:
0x0: B_0x0: No noise is detected
0x1: B_0x1: Noise is detected
Bit 3: Overrun error This bit is set by hardware when the data currently being received in the shift register is ready to be transferred into the USART_RDR register while RXNEÂ =Â 1. It is cleared by a software, writing 1 to the ORECF, in the USART_ICR register. An interrupt is generated if RXNEIEÂ =Â 1 or EIE Â =Â 1 in the USART_CR1 register. Note: When this bit is set, the USART_RDR register content is not lost but the shift register is overwritten. An interrupt is generated if the ORE flag is set during multi buffer communication if the EIE bit is set. This bit is permanently forced to 0 (no overrun detection) when the bit OVRDIS is set in the USART_CR3 register..
Allowed values:
0x0: B_0x0: No overrun error
0x1: B_0x1: Overrun error is detected
Bit 4: Idle line detected This bit is set by hardware when an Idle Line is detected. An interrupt is generated if IDLEIEÂ =Â 1 in the USART_CR1 register. It is cleared by software, writing 1 to the IDLECF in the USART_ICR register. Note: The IDLE bit is not set again until the RXNE bit has been set (i.e. a new idle line occurs). If Mute mode is enabled (MMEÂ =Â 1), IDLE is set if the USART is not mute (RWUÂ =Â 0), whatever the Mute mode selected by the WAKE bit. If RWUÂ =Â 1, IDLE is not set..
Allowed values:
0x0: B_0x0: No Idle line is detected
0x1: B_0x1: Idle line is detected
Bit 5: Read data register not empty RXNE bit is set by hardware when the content of the USART_RDR shift register has been transferred to the USART_RDR register. It is cleared by reading from the USART_RDR register. The RXNE flag can also be cleared by writing 1 to the RXFRQ in the USART_RQR register. An interrupt is generated if RXNEIEÂ =Â 1 in the USART_CR1 register..
Allowed values:
0x0: B_0x0: Data is not received
0x1: B_0x1: Received data is ready to be read.
Bit 6: Transmission complete This bit indicates that the last data written in the USART_TDR has been transmitted out of the shift register. It is set by hardware when the transmission of a frame containing data is complete and when TXE is set. An interrupt is generated if TCIEÂ =Â 1 in the USART_CR1 register. TC bit is is cleared by software, by writing 1 to the TCCF in the USART_ICR register or by a write to the USART_TDR register. Note: If TE bit is reset and no transmission is on going, the TC bit is set immediately..
Allowed values:
0x0: B_0x0: Transmission is not complete
0x1: B_0x1: Transmission is complete
Bit 7: Transmit data register empty TXE is set by hardware when the content of the USART_TDR register has been transferred into the shift register. It is cleared by writing to the USART_TDR register. The TXE flag can also be set by writing 1 to the TXFRQ in the USART_RQR register, in order to discard the data (only in Smartcard T = 0 mode, in case of transmission failure). An interrupt is generated if the TXEIE bit  = 1 in the USART_CR1 register..
Allowed values:
0x0: B_0x0: Data register full
0x1: B_0x1: Data register not full
Bit 8: LIN break detection flag This bit is set by hardware when the LIN break is detected. It is cleared by software, by writing 1 to the LBDCF in the USART_ICR. An interrupt is generated if LBDIE = 1 in the USART_CR2 register. Note: If the USART does not support LIN mode, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: LIN Break not detected
0x1: B_0x1: LIN break detected
Bit 9: CTS interrupt flag This bit is set by hardware when the nCTS input toggles, if the CTSE bit is set. It is cleared by software, by writing 1 to the CTSCF bit in the USART_ICR register. An interrupt is generated if CTSIEÂ =Â 1 in the USART_CR3 register. Note: If the hardware flow control feature is not supported, this bit is reserved and kept at reset value..
Allowed values:
0x0: B_0x0: No change occurred on the nCTS status line
0x1: B_0x1: A change occurred on the nCTS status line
Bit 11: Receiver timeout This bit is set by hardware when the timeout value, programmed in the RTOR register has lapsed, without any communication. It is cleared by software, writing 1 to the RTOCF bit in the USART_ICR register. An interrupt is generated if RTOIEÂ =Â 1 in the USART_CR2 register. In Smartcard mode, the timeout corresponds to the CWT or BWT timings. Note: If a time equal to the value programmed in RTOR register separates 2 characters, RTOF is not set. If this time exceeds this value + 2 sample times (2/16 or 2/8, depending on the oversampling method), RTOF flag is set. The counter counts even if RE = 0 but RTOF is set only when RE = 1. If the timeout has already elapsed when RE is set, then RTOF is set. If the USART does not support the Receiver timeout feature, this bit is reserved and kept at reset value..
Allowed values:
0x0: B_0x0: Timeout value not reached
0x1: B_0x1: Timeout value reached without any data reception
Bit 12: End of block flag This bit is set by hardware when a complete block has been received (for example TÂ =Â 1 Smartcard mode). The detection is done when the number of received bytes (from the start of the block, including the prologue) is equal or greater than BLEN + 4. An interrupt is generated if the EOBIEÂ =Â 1 in the USART_CR2 register. It is cleared by software, writing 1 to the EOBCF in the USART_ICR register. Note: If Smartcard mode is not supported, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: End of Block not reached
0x1: B_0x1: End of Block (number of characters) reached
Bit 13: SPI slave underrun error flag In slave transmission mode, this flag is set when the first clock pulse for data transmission appears while the software has not yet loaded any value into USART_TDR. This flag is reset by setting UDRCF bit in the USART_ICR register. Note: If the USART does not support the SPI slave mode, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: No underrun error
0x1: B_0x1: underrun error
Bit 14: Auto baud rate error This bit is set by hardware if the baud rate measurement failed (baud rate out of range or character comparison failed) It is cleared by software, by writing 1 to the ABRRQ bit in the USART_CR3 register. Note: If the USART does not support the auto baud rate feature, this bit is reserved and kept at reset value..
Bit 15: Auto baud rate flag This bit is set by hardware when the automatic baud rate has been set (RXNE is also set, generating an interrupt if RXNEIE = 1) or when the auto baud rate operation was completed without success (ABREÂ =Â 1) (ABRE, RXNE and FE are also set in this case) It is cleared by software, in order to request a new auto baud rate detection, by writing 1 to the ABRRQ in the USART_RQR register. Note: If the USART does not support the auto baud rate feature, this bit is reserved and kept at reset value..
Bit 16: Busy flag This bit is set and reset by hardware. It is active when a communication is ongoing on the RX line (successful start bit detected). It is reset at the end of the reception (successful or not)..
Allowed values:
0x0: B_0x0: USART is idle (no reception)
0x1: B_0x1: Reception on going
Bit 17: Character match flag This bit is set by hardware, when a the character defined by ADD[7:0] is received. It is cleared by software, writing 1 to the CMCF in the USART_ICR register. An interrupt is generated if CMIEÂ =Â 1in the USART_CR1 register..
Allowed values:
0x0: B_0x0: No Character match detected
0x1: B_0x1: Character Match detected
Bit 18: Send break flag This bit indicates that a send break character was requested. It is set by software, by writing 1 to the SBKRQ bit in the USART_CR3 register. It is automatically reset by hardware during the stop bit of break transmission..
Allowed values:
0x0: B_0x0: Break character transmitted
0x1: B_0x1: Break character requested by setting SBKRQ bit in USART_RQR register
Bit 19: Receiver wakeup from Mute mode This bit indicates if the USART is in Mute mode. It is cleared/set by hardware when a wakeup/mute sequence is recognized. The Mute mode control sequence (address or IDLE) is selected by the WAKE bit in the USART_CR1 register. When wakeup on IDLE mode is selected, this bit can only be set by software, writing 1 to the MMRQ bit in the USART_RQR register. Note: If the USART does not support the wakeup from Stop feature, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Receiver in active mode
0x1: B_0x1: Receiver in Mute mode
Bit 20: Wakeup from low-power mode flag This bit is set by hardware, when a wakeup event is detected. The event is defined by the WUS bitfield. It is cleared by software, writing a 1 to the WUCF in the USART_ICR register. An interrupt is generated if WUFIEÂ =Â 1 in the USART_CR3 register. Note: When UESM is cleared, WUF flag is also cleared. If the USART does not support the wakeup from Stop feature, this bit is reserved and kept at reset value. Refer to ..
Bit 21: Transmit enable acknowledge flag This bit is set/reset by hardware, when the Transmit Enable value is taken into account by the USART. It can be used when an idle frame request is generated by writing TEÂ =Â 0, followed by TEÂ =Â 1 in the USART_CR1 register, in order to respect the TEÂ =Â 0 minimum period..
Bit 22: Receive enable acknowledge flag This bit is set/reset by hardware, when the Receive Enable value is taken into account by the USART. It can be used to verify that the USART is ready for reception before entering low-power mode. Note: If the USART does not support the wakeup from Stop feature, this bit is reserved and kept at reset value. Refer to ..
Bit 25: Transmission complete before guard time flag This bit is set when the last data written in the USART_TDR has been transmitted correctly out of the shift register. It is set by hardware in Smartcard mode, if the transmission of a frame containing data is complete and if the smartcard did not send back any NACK. An interrupt is generated if TCBGTIE = 1 in the USART_CR3 register. This bit is cleared by software, by writing 1 to the TCBGTCF in the USART_ICR register or by a write to the USART_TDR register. Note: If the USART does not support the Smartcard mode, this bit is reserved and kept at reset value. If the USART supports the Smartcard mode and the Smartcard mode is enabled, the TCBGT reset value is '1â. Refer to on page 835..
Allowed values:
0x0: B_0x0: Transmission is not complete or transmission is complete unsuccessfully (i.e. a NACK is received from the card)
0x1: B_0x1: Transmission is complete successfully (before Guard time completion and there is no NACK from the smart card).
Interrupt & status register
Offset: 0x1C, reset: 0x008000C0, access: read-only
28/28 fields covered.
Bit 0: Parity error This bit is set by hardware when a parity error occurs in receiver mode. It is cleared by software, writing 1 to the PECF in the USART_ICR register. An interrupt is generated if PEIE = 1 in the USART_CR1 register. Note: This error is associated with the character in the USART_RDR..
Allowed values:
0x0: B_0x0: No parity error
0x1: B_0x1: Parity error
Bit 1: Framing error This bit is set by hardware when a de-synchronization, excessive noise or a break character is detected. It is cleared by software, writing 1 to the FECF bit in the USART_ICR register. When transmitting data in Smartcard mode, this bit is set when the maximum number of transmit attempts is reached without success (the card NACKs the data frame). An interrupt is generated if EIEÂ =Â 1 in the USART_CR1 register. Note: This error is associated with the character in the USART_RDR..
Allowed values:
0x0: B_0x0: No Framing error is detected
0x1: B_0x1: Framing error or break character is detected
Bit 2: Noise detection flag This bit is set by hardware when noise is detected on a received frame. It is cleared by software, writing 1 to the NECF bit in the USART_ICR register. Note: This bit does not generate an interrupt as it appears at the same time as the RXFNE bit which itself generates an interrupt. An interrupt is generated when the NE flag is set during multi buffer communication if the EIE bit is set. When the line is noise-free, the NE flag can be disabled by programming the ONEBIT bit to 1 to increase the USART tolerance to deviations (Refer to Tolerance of the USART receiver to clock deviation on page 861). This error is associated with the character in the USART_RDR..
Allowed values:
0x0: B_0x0: No noise is detected
0x1: B_0x1: Noise is detected
Bit 3: Overrun error This bit is set by hardware when the data currently being received in the shift register is ready to be transferred into the USART_RDR register while RXFF = 1. It is cleared by a software, writing 1 to the ORECF, in the USART_ICR register. An interrupt is generated if RXFNEIEÂ =Â 1 or EIE = 1 in the USART_CR1 register. Note: When this bit is set, the USART_RDR register content is not lost but the shift register is overwritten. An interrupt is generated if the ORE flag is set during multi buffer communication if the EIE bit is set. This bit is permanently forced to 0 (no overrun detection) when the bit OVRDIS is set in the USART_CR3 register..
Allowed values:
0x0: B_0x0: No overrun error
0x1: B_0x1: Overrun error is detected
Bit 4: Idle line detected This bit is set by hardware when an Idle Line is detected. An interrupt is generated if IDLEIEÂ =Â 1 in the USART_CR1 register. It is cleared by software, writing 1 to the IDLECF in the USART_ICR register. Note: The IDLE bit is not set again until the RXFNE bit has been set (i.e. a new idle line occurs). If Mute mode is enabled (MMEÂ =Â 1), IDLE is set if the USART is not mute (RWUÂ =Â 0), whatever the Mute mode selected by the WAKE bit. If RWUÂ =Â 1, IDLE is not set..
Allowed values:
0x0: B_0x0: No Idle line is detected
0x1: B_0x1: Idle line is detected
Bit 5: RXFIFO not empty RXFNE bit is set by hardware when the RXFIFO is not empty, meaning that data can be read from the USART_RDR register. Every read operation from the USART_RDR frees a location in the RXFIFO. RXFNE is cleared when the RXFIFO is empty. The RXFNE flag can also be cleared by writing 1 to the RXFRQ in the USART_RQR register. An interrupt is generated if RXFNEIEÂ =Â 1 in the USART_CR1 register..
Allowed values:
0x0: B_0x0: Data is not received
0x1: B_0x1: Received data is ready to be read.
Bit 6: Transmission complete This bit indicates that the last data written in the USART_TDR has been transmitted out of the shift register. It is set by hardware when the transmission of a frame containing data is complete and when TXFE is set. An interrupt is generated if TCIEÂ =Â 1 in the USART_CR1 register. TC bit is is cleared by software, by writing 1 to the TCCF in the USART_ICR register or by a write to the USART_TDR register. Note: If TE bit is reset and no transmission is on going, the TC bit is immediately set..
Allowed values:
0x0: B_0x0: Transmission is not complete
0x1: B_0x1: Transmission is complete
Bit 7: TXFIFO not full TXFNF is set by hardware when TXFIFO is not full meaning that data can be written in the USART_TDR. Every write operation to the USART_TDR places the data in the TXFIFO. This flag remains set until the TXFIFO is full. When the TXFIFO is full, this flag is cleared indicating that data can not be written into the USART_TDR. An interrupt is generated if the TXFNFIE bit =1 in the USART_CR1 register. Note: The TXFNF is kept reset during the flush request until TXFIFO is empty. After sending the flush request (by setting TXFRQ bit), the flag TXFNF should be checked prior to writing in TXFIFO (TXFNF and TXFE are set at the same time). This bit is used during single buffer transmission..
Allowed values:
0x0: B_0x0: Transmit FIFO is full
0x1: B_0x1: Transmit FIFO is not full
Bit 8: LIN break detection flag This bit is set by hardware when the LIN break is detected. It is cleared by software, by writing 1 to the LBDCF in the USART_ICR. An interrupt is generated if LBDIE = 1 in the USART_CR2 register. Note: If the USART does not support LIN mode, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: LIN Break not detected
0x1: B_0x1: LIN break detected
Bit 9: CTS interrupt flag This bit is set by hardware when the nCTS input toggles, if the CTSE bit is set. It is cleared by software, by writing 1 to the CTSCF bit in the USART_ICR register. An interrupt is generated if CTSIEÂ =Â 1 in the USART_CR3 register. Note: If the hardware flow control feature is not supported, this bit is reserved and kept at reset value..
Allowed values:
0x0: B_0x0: No change occurred on the nCTS status line
0x1: B_0x1: A change occurred on the nCTS status line
Bit 11: Receiver timeout This bit is set by hardware when the timeout value, programmed in the RTOR register has lapsed, without any communication. It is cleared by software, writing 1 to the RTOCF bit in the USART_ICR register. An interrupt is generated if RTOIEÂ =Â 1 in the USART_CR2 register. In Smartcard mode, the timeout corresponds to the CWT or BWT timings. Note: If a time equal to the value programmed in RTOR register separates 2 characters, RTOF is not set. If this time exceeds this value + 2 sample times (2/16 or 2/8, depending on the oversampling method), RTOF flag is set. The counter counts even if RE = 0 but RTOF is set only when RE = 1. If the timeout has already elapsed when RE is set, then RTOF is set. If the USART does not support the Receiver timeout feature, this bit is reserved and kept at reset value..
Allowed values:
0x0: B_0x0: Timeout value not reached
0x1: B_0x1: Timeout value reached without any data reception
Bit 12: End of block flag This bit is set by hardware when a complete block has been received (for example TÂ =Â 1 Smartcard mode). The detection is done when the number of received bytes (from the start of the block, including the prologue) is equal or greater than BLEN + 4. An interrupt is generated if the EOBIEÂ =Â 1 in the USART_CR2 register. It is cleared by software, writing 1 to the EOBCF in the USART_ICR register. Note: If Smartcard mode is not supported, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: End of Block not reached
0x1: B_0x1: End of Block (number of characters) reached
Bit 13: SPI slave underrun error flag In slave transmission mode, this flag is set when the first clock pulse for data transmission appears while the software has not yet loaded any value into USART_TDR. This flag is reset by setting UDRCF bit in the USART_ICR register. Note: If the USART does not support the SPI slave mode, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: No underrun error
0x1: B_0x1: underrun error
Bit 14: Auto baud rate error This bit is set by hardware if the baud rate measurement failed (baud rate out of range or character comparison failed) It is cleared by software, by writing 1 to the ABRRQ bit in the USART_CR3 register. Note: If the USART does not support the auto baud rate feature, this bit is reserved and kept at reset value..
Bit 15: Auto baud rate flag This bit is set by hardware when the automatic baud rate has been set (RXFNE is also set, generating an interrupt if RXFNEIE = 1) or when the auto baud rate operation was completed without success (ABREÂ =Â 1) (ABRE, RXFNE and FE are also set in this case) It is cleared by software, in order to request a new auto baud rate detection, by writing 1 to the ABRRQ in the USART_RQR register. Note: If the USART does not support the auto baud rate feature, this bit is reserved and kept at reset value..
Bit 16: Busy flag This bit is set and reset by hardware. It is active when a communication is ongoing on the RX line (successful start bit detected). It is reset at the end of the reception (successful or not)..
Allowed values:
0x0: B_0x0: USART is idle (no reception)
0x1: B_0x1: Reception on going
Bit 17: Character match flag This bit is set by hardware, when a the character defined by ADD[7:0] is received. It is cleared by software, writing 1 to the CMCF in the USART_ICR register. An interrupt is generated if CMIEÂ =Â 1in the USART_CR1 register..
Allowed values:
0x0: B_0x0: No Character match detected
0x1: B_0x1: Character Match detected
Bit 18: Send break flag This bit indicates that a send break character was requested. It is set by software, by writing 1 to the SBKRQ bit in the USART_CR3 register. It is automatically reset by hardware during the stop bit of break transmission..
Allowed values:
0x0: B_0x0: Break character transmitted
0x1: B_0x1: Break character requested by setting SBKRQ bit in USART_RQR register
Bit 19: Receiver wakeup from Mute mode This bit indicates if the USART is in Mute mode. It is cleared/set by hardware when a wakeup/mute sequence is recognized. The Mute mode control sequence (address or IDLE) is selected by the WAKE bit in the USART_CR1 register. When wakeup on IDLE mode is selected, this bit can only be set by software, writing 1 to the MMRQ bit in the USART_RQR register. Note: If the USART does not support the wakeup from Stop feature, this bit is reserved and kept at reset value. Refer to ..
Allowed values:
0x0: B_0x0: Receiver in active mode
0x1: B_0x1: Receiver in Mute mode
Bit 20: Wakeup from low-power mode flag This bit is set by hardware, when a wakeup event is detected. The event is defined by the WUS bitfield. It is cleared by software, writing a 1 to the WUCF in the USART_ICR register. An interrupt is generated if WUFIEÂ =Â 1 in the USART_CR3 register. Note: When UESM is cleared, WUF flag is also cleared. If the USART does not support the wakeup from Stop feature, this bit is reserved and kept at reset value. Refer to ..
Bit 21: Transmit enable acknowledge flag This bit is set/reset by hardware, when the Transmit Enable value is taken into account by the USART. It can be used when an idle frame request is generated by writing TEÂ =Â 0, followed by TEÂ =Â 1 in the USART_CR1 register, in order to respect the TEÂ =Â 0 minimum period..
Bit 22: Receive enable acknowledge flag This bit is set/reset by hardware, when the Receive Enable value is taken into account by the USART. It can be used to verify that the USART is ready for reception before entering low-power mode. Note: If the USART does not support the wakeup from Stop feature, this bit is reserved and kept at reset value. Refer to ..
Bit 23: TXFIFO empty This bit is set by hardware when TXFIFO is empty. When the TXFIFO contains at least one data, this flag is cleared. The TXFE flag can also be set by writing 1 to the bit TXFRQ (bit 4) in the USART_RQR register. An interrupt is generated if the TXFEIE bit  = 1 (bit 30) in the USART_CR1 register..
Allowed values:
0x0: B_0x0: TXFIFO not empty.
0x1: B_0x1: TXFIFO empty.
Bit 24: RXFIFO full This bit is set by hardware when the number of received data corresponds to RXFIFO size + 1 (RXFIFO full + 1 data in the USART_RDR register. An interrupt is generated if the RXFFIE bit  = 1 in the USART_CR1 register..
Allowed values:
0x0: B_0x0: RXFIFO not full.
0x1: B_0x1: RXFIFO Full.
Bit 25: Transmission complete before guard time flag This bit is set when the last data written in the USART_TDR has been transmitted correctly out of the shift register. It is set by hardware in Smartcard mode, if the transmission of a frame containing data is complete and if the smartcard did not send back any NACK. An interrupt is generated if TCBGTIE = 1 in the USART_CR3 register. This bit is cleared by software, by writing 1 to the TCBGTCF in the USART_ICR register or by a write to the USART_TDR register. Note: If the USART does not support the Smartcard mode, this bit is reserved and kept at reset value. If the USART supports the Smartcard mode and the Smartcard mode is enabled, the TCBGT reset value is '1â. Refer to on page 835..
Allowed values:
0x0: B_0x0: Transmission is not complete or transmission is complete unsuccessfully (i.e. a NACK is received from the card)
0x1: B_0x1: Transmission is complete successfully (before Guard time completion and there is no NACK from the smart card).
Bit 26: RXFIFO threshold flag This bit is set by hardware when the threshold programmed in RXFTCFG in USART_CR3 register is reached. This means that there are (RXFTCFG - 1) data in the Receive FIFO and one data in the USART_RDR register. An interrupt is generated if the RXFTIE bit  = 1 (bit 27) in the USART_CR3 register. Note: When the RXFTCFG threshold is configured to '101â, RXFT flag is set if 16 data are available i.e. 15 data in the RXFIFO and 1 data in the USART_RDR. Consequently, the 17th received data does not cause an overrun error. The overrun error occurs after receiving the 18th data..
Allowed values:
0x0: B_0x0: Receive FIFO does not reach the programmed threshold.
0x1: B_0x1: Receive FIFO reached the programmed threshold.
Bit 27: TXFIFO threshold flag This bit is set by hardware when the TXFIFO reaches the threshold programmed in TXFTCFG of USART_CR3 register i.e. the TXFIFO contains TXFTCFG empty locations. An interrupt is generated if the TXFTIE bit  = 1 (bit 31) in the USART_CR3 register..
Allowed values:
0x0: B_0x0: TXFIFO does not reach the programmed threshold.
0x1: B_0x1: TXFIFO reached the programmed threshold.
Receive data register
Offset: 0x24, reset: 0x0000, access: read-only
1/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
RDR
r |
|||||||||||||||
Transmit data register
Offset: 0x28, reset: 0x0000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
TDR
rw |
|||||||||||||||
Prescaler register
Offset: 0x2C, reset: 0x0000, access: read-write
1/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
PRESCALER
rw |
|||||||||||||||
Bits 0-3: Clock prescaler The USART input clock can be divided by a prescaler factor: Remaining combinations: Reserved Note: When PRESCALER is programmed with a value different of the allowed ones, programmed prescaler value is 1011 i.e. input clock divided by 256..
Allowed values:
0x0: B_0x0: input clock not divided
0x1: B_0x1: input clock divided by 2
0x2: B_0x2: input clock divided by 4
0x3: B_0x3: input clock divided by 6
0x4: B_0x4: input clock divided by 8
0x5: B_0x5: input clock divided by 10
0x6: B_0x6: input clock divided by 12
0x7: B_0x7: input clock divided by 16
0x8: B_0x8: input clock divided by 32
0x9: B_0x9: input clock divided by 64
0xA: B_0xA: input clock divided by 128
0xB: B_0xB: input clock divided by 256
0x40010030: System configuration controller
4/5 fields covered. Toggle Registers
| Offset | Name | 31 |
30 |
29 |
28 |
27 |
26 |
25 |
24 |
23 |
22 |
21 |
20 |
19 |
18 |
17 |
16 |
15 |
14 |
13 |
12 |
11 |
10 |
9 |
8 |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x0 | VREFBUF_CSR | ||||||||||||||||||||||||||||||||
| 0x4 | VREFBUF_CCR | ||||||||||||||||||||||||||||||||
VREFBUF control and status register
Offset: 0x0, reset: 0x00000002, access: Unspecified
4/4 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
VRR
r |
VRS
rw |
HIZ
rw |
ENVR
rw |
||||||||||||
Bit 0: Voltage reference buffer mode enable This bit is used to enable the voltage reference buffer mode..
Allowed values:
0x0: B_0x0: Internal voltage reference mode disable (external voltage reference mode).
0x1: B_0x1: Internal voltage reference mode (reference buffer enable or hold mode) enable.
Bit 1: High impedance mode This bit controls the analog switch to connect or not the VREF+ pin. Refer to for the mode descriptions depending on ENVR bit configuration..
Allowed values:
0x0: B_0x0: VREF+ pin is internally connected to the voltage reference buffer output.
0x1: B_0x1: VREF+ pin is high impedance.
VREFBUF calibration control register
Offset: 0x4, reset: 0x00000000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
TRIM
rw |
|||||||||||||||
0x40002C00: System window watchdog
2/6 fields covered. Toggle Registers
| Offset | Name | 31 |
30 |
29 |
28 |
27 |
26 |
25 |
24 |
23 |
22 |
21 |
20 |
19 |
18 |
17 |
16 |
15 |
14 |
13 |
12 |
11 |
10 |
9 |
8 |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x0 | WWDG_CR | ||||||||||||||||||||||||||||||||
| 0x4 | WWDG_CFR | ||||||||||||||||||||||||||||||||
| 0x8 | WWDG_SR | ||||||||||||||||||||||||||||||||
Control register
Offset: 0x0, reset: 0x0000007F, access: read-write
1/2 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
WDGA
rw |
T
rw |
||||||||||||||
Configuration register
Offset: 0x4, reset: 0x0000007F, access: read-write
1/3 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
WDGTB
rw |
EWI
rw |
W
rw |
|||||||||||||
Bits 11-13: Timer base The timebase of the prescaler can be modified as follows:.
Allowed values:
0x0: B_0x0: CK Counter Clock (PCLK div 4096) div 1
0x1: B_0x1: CK Counter Clock (PCLK div 4096) div 2
0x2: B_0x2: CK Counter Clock (PCLK div 4096) div 4
0x3: B_0x3: CK Counter Clock (PCLK div 4096) div 8
0x4: B_0x4: CK Counter Clock (PCLK div 4096) div 16
0x5: B_0x5: CK Counter Clock (PCLK div 4096) div 32
0x6: B_0x6: CK Counter Clock (PCLK div 4096) div 64
0x7: B_0x7: CK Counter Clock (PCLK div 4096) div 128
Status register
Offset: 0x8, reset: 0x00000000, access: read-write
0/1 fields covered.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
EWIF
rw |
|||||||||||||||